in reply to Re^2: empty a file
in thread empty a file

So why don't you change the open statement then? If you're overwriting the file, it's not very useful to open in append mode.

Replies are listed 'Best First'.
A reply falls below the community's threshold of quality. You may see it by logging in.