Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: Deleting on Files

by Albannach (Prior)
on Feb 28, 2007 at 16:48 UTC ( #602546=note: print w/ replies, xml ) Need Help??


in reply to Deleting on Files

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.

--
I'd like to be able to assign to an luser


Comment on Re: Deleting on Files
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://602546]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (9)
As of 2014-08-02 07:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Who would be the most fun to work for?















    Results (55 votes), past polls