Subject: Re: rmdir(".")
To: Roland Illig <rillig@netbsd.org>
From: Xin LI <delphij@gmail.com>
List: tech-kern
Date: 09/09/2005 21:50:36
I think the reason would be that the dot is just a hard link to the
current directory, while the removal semantic requires that you remove
a name (say, the $PWD) instead of just decreasing 1 of the refcnt.

On 9/9/05, Roland Illig <rillig@netbsd.org> wrote:
> Hi folks,
>=20
> is there any technical reason for not allowing rmdir("."), or is it just
> to protect the user from something {s,}he might eventually not want to
> do? I'm not interested in a flame war, I just want to know the reasons
> for it. (I'm still too young to know everything about Unix-like systems. =
;))
>=20
> http://www.opengroup.org/onlinepubs/009695399/functions/rmdir.html says
> removing the current working directory is allowed.
>=20
> By the way, the error code is wrong. It should not be EINVAL, but EBUSY.
>=20
> Roland
>