Perl-Sensitive Sunglasses | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Update: (added a little more code) You might consider:
Of course, this example is a little contrived, since if you open the file for writing like that and then close it, I think it will truncate it without needing the truncate command. But I can conceive of using that truncate() command if I had been writing to a file and then decided to start over. I must admit, I have never used it. Another update: Ah, as pointed out by [id://bluto], the truncate command also can be called in the form:
... which is at least somewhat more useful. If the file is not owned by you, then you may need to have group- or world- writable permissions set on it, depending on your operating system. No good deed goes unpunished. -- (attributed to) Oscar Wilde In reply to Re: Zeroing A File
by ptum
|
|