unlink. but you should be able to do in in the shell, by /usr/bin/rmdir -- -I or something.
Update: oops, merlyn's right. but you can delete from the shell (it would be a pretty bad shell if you couldn't.)
Update: after a quick read of the docs, it turns out merlyn's right in spirit, but not in fact. unlink can be used to delete directories, but it probably shouldn't. use rmdir, as both merlyn and the doc point out.
~Particle *accelerates* | [reply] |
| [reply] |
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 "$_".
| [reply] |
This is really more a unix question than a perl question, but... rm ./-I will delete the file. So long as the first character is not a dash, then it works fine. Quotes are stripped by the shell, so they don't count as characters.
Update: D'oh! As pepik_knize pointed out below, it's a
directory, not a file. rmdir ./-I is what I should have said.
| [reply] [d/l] |
but... rm ./-I will delete the file
Almost. It's a directory, so you would need rm -R to get rid of it (and everything in it).
Pepik
Of all the causes that conspire to blind
Man's erring judgment, and misguide the mind,
What the weak head with strongest bias rules,
Is pride, the never-failing vice of fools.
-- Pope.
(Humble to be American.)
| [reply] |