Re: rmdir of one's pwd (was Re: rmdir of a busy directory)

Guest section DW (dwguest@win.tue.nl)
Sat, 13 Feb 1999 16:37:46 +0100 (MET)


From: Ralf Corsepius <corsepiu@faw.uni-ulm.de>

Linus Torvalds wrote:

> Show me POSIX or other standards that say that you can't do it, and I
> guess I have to work around a standards problem, but right now I say that
> if programs ask for 'rmdir(".")', then they had better get it. I don't
> think the OS should second-guess anybody.

I don't know about a formal standard, either.

Nevertheless, in my initial post, I wasn't talking about rmdir (2), I was
talking about rmdir(1)'s behaviour on linux-2.[12].x breaking gcc/fixincludes
for building cross-compilers.

A formal standard for rmdir(1) can be found in POSIX.2
(I have the 1993-12-22 edition here).
It says:

"The rmdir utility shall remove the directory entry specified by each operand,
which shall refer to an empty directory."

No exception is made for ".".
Thus, gcc/fixincludes needs fixing.

Andries

-
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/