http://qs1969.pair.com?node_id=370033


in reply to empty a file

Either you open the file in append mode or you truncate the file. The two thing don't logically go together.

Why don't you simply open the file in non-append mode? you'd get the same result as truncate plus append.