From owner-freebsd-hackers Wed Apr 10 4:48:44 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from mail8.nc.rr.com (fe8.southeast.rr.com [24.93.67.55]) by hub.freebsd.org (Postfix) with ESMTP id 50F5D37B405 for ; Wed, 10 Apr 2002 04:48:34 -0700 (PDT) Received: from i8k.babbleon.org ([66.57.86.84]) by mail8.nc.rr.com with Microsoft SMTPSVC(5.5.1877.687.68); Wed, 10 Apr 2002 07:48:30 -0400 Received: by i8k.babbleon.org (Postfix, from userid 111) id 6F9F8BB39; Wed, 10 Apr 2002 07:48:13 -0400 (EDT) Content-Type: text/plain; charset="iso-8859-1" From: Brian T.Schellenberger To: Bogdan TARU , "Rogier R. Mulhuijzen" , Terry Lambert , Subject: Re: 'rm' incompatibility with Posix.2 Date: Wed, 10 Apr 2002 07:48:12 -0400 X-Mailer: KMail [version 1.3] References: <20020410103608.F79910-100000@fw.cgn.icom> In-Reply-To: <20020410103608.F79910-100000@fw.cgn.icom> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-Id: <20020410114813.6F9F8BB39@i8k.babbleon.org> 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 On Wednesday 10 April 2002 04:45 am, Bogdan TARU wrote: | Dear Rogier & Terry, | | I didn't say the behaviour contradicts Posix.2. I just said that Posix.2 | specifies removal of the trailing slashes when doing directory operation. I don't think I follow the distinction here. If posix requires removal of the trailing slashes on directory operations, and it is your perception that FreeBSD does not do this, then it seems to me that you *are* saying the FreeBSd contradicts Posix.2. Aren't you? I mean, isn't that the complaint? That said, what you've cited isn't a case of a directory operation; it's a case of a symbolic-link operation. Does Posix.2 say anything one way or another about those? In other words, what you are describing here (behavior of which I was utterly unaware, but now that I am I certainly hope it doesn't change because it seems quite convenient) is the following algorithm used by FreeBSD: If there is a symbolic link with a trailing /, then resolve the symbolic link into the target. I don't think it's resolving it into "the target with a trailing slash"; thus, with mkdir dir ln -s dir link rm -r link/ is the same as rm -r dir But the posix rule you cited doesn't seem to me to have anything to do with this case; rather it merely says that rm -r dir/ is the same as rm -r dir It is of entirely possible that posix2 (which I've never even glanced at) has some *other* rule that implies that the FreeBSD behavior is nonconforming, but this rule doesn't seem to me to be applicable to this case. | Which, for example, freebsd 'rm' does not, which leads to a strange | behaviour. As I stated, I have tryied this on more than one other OS | (OpenBSD 2.9, 3.0, Linux, HP UX 10.20, Solaris 2.7, 2.8), and all yelded | the same result (different from the FreeBSD). | | Also, I quote from the FreeBSD man page of 'rm': | | "The rm utility removes symbolic links, not the files referenced by | the links." | | Greetings, | bogdan | | On Wed, 10 Apr 2002, Rogier R. Mulhuijzen wrote: | > > I have attached a patch for the 'rm' untility, which strips the | > > trailing slash(es) from the path (according to Posix.2). But I think | > > there are many other utilities which need to be patched (e.g. cp, mv). | > | > Can you point out how the behavior violates POSIX.2? | > | > Doc | | To Unsubscribe: send mail to majordomo@FreeBSD.org | with "unsubscribe freebsd-hackers" in the body of the message -- Brian T. Schellenberger . . . . . . . bts@wnt.sas.com (work) Brian, the man from Babble-On . . . . bts@babbleon.org (personal) ME --> http://www.babbleon.org http://www.eff.org <-- GOOD GUYS --> http://www.programming-freedom.org To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message