in reply to •Re: Re: deleting directory named -I (as Ice).
in thread deleting directory named -I (as Ice).

from the docs...

unlink LIST
unlink Deletes a list of files. Returns the number of files successfully deleted.

$cnt = unlink 'a', 'b', 'c';
unlink @goners;
unlink <*.bak>;

"unlink" will not delete directories unless
you are superuser and the -U flag is supplied to
Perl. Even if these conditions are met, be warned
that unlinking a directory can inflict damage on
your filesystem. Use "rmdir" instead.

If LIST is omitted, uses "$_".
  • Comment on Re: ?Re: Re: deleting directory named -I (as Ice).

Replies are listed 'Best First'.
Re: Re: ?Re: Re: deleting directory named -I (as Ice).
by IlyaM (Parson) on May 22, 2002 at 08:56 UTC
    Strictly speacking you can use unlink to delete directories but it works differently than rmdir. For example you can unlink directory which has some files in it and it likely to leave you with corrupted filesystem but you cannot do same with rmdir which will just fail in this case.

    --
    Ilya Martynov (http://martynov.org/)