Re: Deleting files
- From: Bart Lateur <bart.lateur@xxxxxxxxxx>
- Date: Sat, 02 Jun 2007 20:22:01 GMT
Anders F wrote:
Is there a Perl subroutine for deleting files?
There's a builtin. It's called "unlink".
http://perldoc.perl.org/functions/unlink.html
The reason for the odd name is because on Unix, there's no garantee that
if you succesfully apply this function on a file, that it will indeed be
deleted. There' something called a "hard link", so there can be multiple
directory entries, possibly in more than one directory, for the same
file. "unlink" will remove one such directory entry (called a "link").
Only when all links are gone, will the file contents indeed be deleted.
--
Bart.
.
- Follow-Ups:
- Re: Deleting files
- From: Tim S
- Re: Deleting files
- References:
- Deleting files
- From: Anders F
- Deleting files
- Prev by Date: Re: Deleting files
- Next by Date: Re: Deleting files
- Previous by thread: Re: Deleting files
- Next by thread: Re: Deleting files
- Index(es):
Relevant Pages
|