in reply to How to erase the file content


try this

system(": > $filename");