in reply to file input output problem
At the time your script sees this file it is already truncated.