Re: [off-topic] rm -r on a used directory
On Fri, Jan 16, 1998 at 12:02:11AM +0200, fpolacco@icenet.fi wrote:
> On 14 Jan, Adrian Bridgett wrote:
> > At work on AIX, if I do this:
> >
> > mkdir foo
> > mkdir foo/bar
> > cd foo/bar
> > rm -r ../../foo
> >
> > the last command fails as it is my current directory. This works without a
> > problem on Linux - it just leaves me in a non-existant dir.
>
> Are you sure that it works without a problem?
>
> $ rm -r ../../foo ; echo $?
> rm: ../../foo: No such file or directory
> rm: ../../foo: No such file or directory
> 1
>
> it failed, as you can see ...
>
> $ ls .
> /bin/ls: .: No such file or directory
>
> ... and leaves you in troubles ...
>
> $ ls -lA /tmp/a/b/c/
> total 1
> drwxr-xr-x 2 fab fab 1024 Jan 15 11:12 foo
>
> without having removed the requested dir
>
> I think that AIX behaviour is better.
> Are you sure that Posix doesn't require that . should always exist?
> A lot of programs require that (find, for example).
I got the same behaviour as you in /tmp, but it _does_ work from a normal
directory (I used my home directory).
I was suprised to discover that find needs the current directory - even when
called like "find /usr/doc/dpkg"
Adrian
email: adrian.bridgett@poboxes.com | Debian Linux - www.debian.org
http://www.poboxes.com/adrian.bridgett | Because bloated, unstable
PGP key available on public key servers | operating systems are from MS
--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to
debian-devel-request@lists.debian.org .
Trouble? e-mail to templin@bucknell.edu .
Reply to: