Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Hi,
I need to delete a file before executing a script. The file itself is recreated by the script using the filehandle >>.
However, when i try to unlink the file, the error "No such file or directory" is printed. The file does though exist?
unlink "data/remove.txt" or die "unable to delete $!";
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: delete a file
by reasonablekeith (Deacon) on Jun 16, 2005 at 09:15 UTC | |
Re: delete a file
by jpeg (Chaplain) on Jun 16, 2005 at 09:15 UTC | |
by Anonymous Monk on Jun 16, 2005 at 09:19 UTC | |
by jpeg (Chaplain) on Jun 16, 2005 at 09:34 UTC | |
Re: delete a file
by TedPride (Priest) on Jun 16, 2005 at 12:33 UTC | |
Re: delete a file
by kyoshu (Curate) on Jun 16, 2005 at 09:15 UTC | |
Re: delete a file
by Anonymous Monk on Jun 16, 2005 at 10:08 UTC | |
|
Back to
Seekers of Perl Wisdom