Skip site navigation (1)Skip section navigation (2)
Date:      10 Apr 2002 16:21:45 +0200
From:      Dag-Erling Smorgrav <des@ofug.org>
To:        Bogdan TARU <bgd@icomag.de>
Cc:        <freebsd-hackers@FreeBSD.ORG>
Subject:   Re: 'rm' incompatibility with Posix.2
Message-ID:  <xzpelhnws5i.fsf@flood.ping.uio.no>
In-Reply-To: <20020410091302.Y79904-200000@fw.cgn.icom>
References:  <20020410091302.Y79904-200000@fw.cgn.icom>

next in thread | previous in thread | raw e-mail | index | archive | help
Bogdan TARU <bgd@icomag.de> writes:
>  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).

Please don't.  This functionality is extremely useful.  Consider this:

des@des ~% mkdir foo
des@des ~% touch foo/bar
des@des ~% ln -s foo baz
des@des ~% ls -l baz
lrwxr-xr-x  1 des  des  3 Apr 10 16:15 baz -> foo
des@des ~% ls -l baz/
total 0
-rw-r--r--  1 des  des  0 Apr 10 16:15 bar

and the same scenario on Solaris:

des@sex ~% mkdir foo
des@sex ~% touch foo/bar
des@sex ~% ln -s foo baz
des@sex ~% ls -l baz
lrwxrwxrwx   1 des      des            3 Apr 10 16:16 baz -> foo/
des@sex ~% ls -l baz/
lrwxrwxrwx   1 des      des            3 Apr 10 16:16 baz/ -> foo/
[scream and curse]
des@sex ~% cd baz
des@sex ~/baz% ls -l
total 0
-rw-------   1 des      des            0 Apr 10 16:16 bar

In my humble opinion, Solaris (and every other *nix) is broken in this
respect, and *BSD is correct.

DES
-- 
Dag-Erling Smorgrav - des@ofug.org

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?xzpelhnws5i.fsf>