[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Wed, 26 Oct 2005 23:34:49 -0600
Dave Richards wrote:
> Thanks for your thoughts on this issue. The reason for using this
> command (and teaching our support staff to use it) is not technical but
> just to reduce 'human error' and for comfort level.
It would make me nervous to be teaching the unlink command as a
replacement for rm. For one it is just not the normal way of doing
things. Really for inexperienced users it is better to be in the
middle of the pack. The predators cut the slow ones from the edge of
the herd so it is safer in the middle. For another when working as
root there is filesystem dependent behavior around unlink such as I
mentioned. For those who know how to use it this can be very useful.
But I can only think it would eventually trip up someone who does not
know about it.
> - Sometimes people perceive that 'rm' is deleting the file and not just
> the symbolic link. I get calls about that fairly often. They think it
> will delete both at the same time.
For what reason do they perceive this? I have been trying to think of
what would give that indication but I have not thought of anything
yet. Is it something in the info or man page or --help output? Is it
something in the 'rm --verbose' output? What could be done to make
the operation of rm more clear? It seems like a very simple command
to me to be causing such trouble.
> - The other issue is that you know unlink will only get symbolic links
> when doing copy and pastes which people do very quickly. Sometimes you
> get users that put in spaces in file names and then highlight and middle
> mouse those files without putting quotes around them so 'rm' might blow
> out things that they don't want to delete. If you accidentally use
> unlink on a real file, it won't do anything to it. An error with "rm"
> will do what you tell it :)
As Philip Rowlands wrote:
>> Not true. unlink is quite happy to delete real files; I'd even suggest
>> rm is safer, as it will prompt in certain circumstances where unlink
>> won't (--interactive or write-protected files).
Agreed. The unlink command will happily unlink real files. It is not
any safer than rm. In some cases it is less safe.
But I think your description of not quoting filenames with spaces in
them is a clue. Because unlink checks for more than one argument then
in the case you describe unlink would report an error and exit. This
is in contrast to rm which would see them as separate arguments.
Your request to add multiple file argument support to unlink would
mean in your example case the unlink command would behave identically
to rm and would become as dangerous as you described the rm command to
be. (I disagree it is more or less dangerous than rm. But it makes
for a nice point in the case. :-) Therefore I think you are working
counter to yourself!
I would like to leave sleeping dogs lie.
- unlink, Dave Richards, 2005/10/21