size of the file is 1 byte
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Thursday, April 11, 2002 10:25 AM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: RE: Deleting the contents of a file
perldoc -f unlink
-Original Message-
From: Allison Ogle [mail
On Apr 11, Allison Ogle said:
>I want to opena datafile and erase it's all it's contents. Can anyone help?
No need to open the file.
truncate($path_to_file, 0);
--
Jeff "japhy" Pinyan [EMAIL PROTECTED] http://www.pobox.com/~japhy/
RPI Acacia brother #734 http://www.perlmonks.or
Hi, I am very new to PERL but if all you want to do is open an existing file
and delete all of it's contents you could open the file for writing and then
close it.
open(F, ">filename");
close (F);
There maybe a more acceptable way to do this - but this should open the file
- remove its conten
cat /dev/null >datafile
> -Original Message-
> From: Nikola Janceski [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, April 11, 2002 10:33 AM
> To: '[EMAIL PROTECTED]'; [EMAIL PROTECTED]; [EMAIL PROTECTED]
> Subject: RE: Deleting the contents of a file
>
I think...
open(DATA, ">$file") or die "cannot open: $!";
would do the trick.
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, April 11, 2002 10:25 AM
> To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
> Subjec
perldoc -f unlink
-Original Message-
From: Allison Ogle [mailto:[EMAIL PROTECTED]]
Sent: Thursday, April 11, 2002 10:26 AM
To: [EMAIL PROTECTED]
Subject: Deleting the contents of a file
Hi,
I want to opena datafile and erase it's all it's contents. Can anyone help?
Thanks
Hi,
I want to opena datafile and erase it's all it's contents. Can anyone help?
Thanks,
Allison
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]