From owner-freebsd-hackers Wed Apr 10 17:14:10 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from hawk.mail.pas.earthlink.net (hawk.mail.pas.earthlink.net [207.217.120.22]) by hub.freebsd.org (Postfix) with ESMTP id F330237B41A for ; Wed, 10 Apr 2002 17:13:56 -0700 (PDT) Received: from pool0071.cvx40-bradley.dialup.earthlink.net ([216.244.42.71] helo=mindspring.com) by hawk.mail.pas.earthlink.net with esmtp (Exim 3.33 #1) id 16vSDh-0006Sv-00; Wed, 10 Apr 2002 17:13:46 -0700 Message-ID: <3CB4D51F.A4473F9C@mindspring.com> Date: Wed, 10 Apr 2002 17:13:19 -0700 From: Terry Lambert X-Mailer: Mozilla 4.7 [en]C-CCK-MCD {Sony} (Win98; U) X-Accept-Language: en MIME-Version: 1.0 To: "Brian T.Schellenberger" Cc: Peter Kieser , sthaug@nethelp.no, freebsd-hackers@FreeBSD.ORG Subject: Re: 'rm' incompatibility with Posix.2 References: <20020410160038.GA71167@reiher.informatik.uni-wuerzburg> <38103.1018458226@verdi.nethelp.no> <009c01c1e0db$a631dd70$6401a8c0@xeon> <20020410231803.616D4BB39@i8k.babbleon.org> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG "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 majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message