On Aug 11, Tony Frasketi said:

Is there any way in perl to effectively clear the contents of an ***existing*** file (making the file empty) ? I have a log file that I'd like to empty out after it reaches a certain maximum file size.

The truncate() function, which takes a filename OR a filehandle as its argument.

  perldoc -f truncate

--
Jeff "japhy" Pinyan         %  How can we ever be the sold short or
RPI Acacia Brother #734     %  the cheated, we who for every service
http://japhy.perlmonk.org/  %  have long ago been overpaid?
http://www.perlmonks.org/   %    -- Meister Eckhart

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to