"Brian T.Schellenberger" wrote:
> On Wednesday 10 April 2002 06:04 pm, Peter Kieser wrote:
> | I say we just leave it how it is now. Else alot of people are probably
> | going to end up deleting directories by accident. It's perfectly fine how
> | it is, if it's not broken why fix it?
> 
> Well, the question is whether it's broken;
> 
> and right now it FreeBSD sometimes deletes directories; the request is to
> delete the link instead under those circumstances, so the argument from
> "don't avoid directories unless you are certain" would militate in favor of
> changing the behavior.

I've noticed things getting deleted before, other times I've used
the command "rm -rf".  I'm glad I'm not the only one seeing this
behaviour.

8-) 8-) 8-) 8-).


> (Not that I'm advocating such a change.  The FreeBSD behavior seems
> consistent & sensible to me; the Linux behavior [as described on this list]
> does not; other Unices vary, and clearly there is little consistency.  None
> of which matters if people just avoid trailing slashes.  Since trailing
> slashes are rarely seen unless they are deliberately being used to mean
> something special, I prefer FreeBSD's semantics, which do something useful
> with that information over other semantics which always discard that
> information.)

Trailing slashes "magically" appear in shells that do completion,
and in badly fit together scripts, where it's easier to put a
trailing slash on a variable content for a directory, then to
ensure that there is a "/" prefix on non-empty appended path
components (if any -- and the optional nature of them makes it
harder).

It's validly arguable that an "rm -rf foo/" should remove only
"foo", if it is a symlink to a directory, rather than the directory
contents.  If you were to do an "rm -rf fee/", and "fee/" was a
directory containing a symplink "foo" to another directory, you
would expect the link, not the target, to be deleted.

However... I think that the trailing slash semantics are also
arguable, and, being that they are consistant between commands,
more correct than anything that results in an inconsistancy.

I think the most telling thing is "what do we expect when":

        cd /tmp
        mkdir -p foo/fee
        cp /etc/ttys foo/fee/ttys
        ln -s foo xyz
        rm -rf xyz/fee

...we expect it to follow the link "xyz" because of the trailing
"/" in the "xyz/" path component.

-- Terry

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message

Reply via email to