good chemistry is complicated, and a little bit messy -LW |
|
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
While philcrow undoubtedly has the right approach to this problem, I'm surprised nobody has mentioned Perl's own truncate function, which works just fine in Win32 and is neater than the open solutions.
Update: there is no need to open the file, as truncate will operate on the file name, e.g. truncate 'myfile.log', 0; will set the length of the file to zero, but you can use any desired length in that place. -- In reply to Re: Deleting on Files
by Albannach
|
|