Re: rmdir of a busy directory

Ralf Corsepius (corsepiu@faw.uni-ulm.de)
Fri, 12 Feb 1999 11:22:08 +0100


Alan Curry wrote:

> For as long as I can remember, if you removed a directory which is the
> current working directory of a process (for example, a shell), and then tried
> to do anything with that process that accesses the current working directory
> (for example, type "ls"), you'd get a ENOENT.
>
> Under 2.2, though, the opendir(".") succeeds and creates the appearance of an
> empty directory. Even stranger, attempts to creat() or mkdir() in the
> nonexistent directory yield EPERM.
>

This might also be consequence of the same problem:

mkdir <somedir>
cd <somedir>
rmdir .

Under all OSes I tried, the rmdir . command above returns an error. On linux >
2.1.124 (the version I first noticed to be affected) this silently succeeds.

BTW, this behaviour breaks building egcs/gcc/fixincludes for cross-compilers
under linux, because fixincludes (egcs-1.1b and egcs-1.1.1) contain a fragment
which rely on "rmdir ." failing.

> Is this now the expected behavior, or was there an accident in last-minute
> rmdir() changes?

Ralf.

--
Ralf Corsepius
Forschungsinstitut fuer Anwendungsorientierte Wissensverarbeitung (FAW)
Helmholtzstr. 16, 89081 Ulm, Germany     Tel: +49/731/501-8690
mailto:corsepiu@faw.uni-ulm.de           FAX: +49/731/501-999
http://www.faw.uni-ulm.de

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/