bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#20835: rmdir foo/. fails


From: Pádraig Brady
Subject: bug#20835: rmdir foo/. fails
Date: Wed, 17 Jun 2015 12:11:22 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0

On 17/06/15 12:03, Ed Avis wrote:
> Thanks Pádraig Brady for your reply.  You mentioned the manual page for
> rmdir(2) and the POSIX spec.  But isn't that POSIX spec talking about the
> rmdir(2) system call - not the rmdir(1) executable?
> 
> As far as I know there is no requirement that rmdir(1) be an exact wrapper
> for rmdir(2); rather its purpose as stated in the the documentation is to
> remove empty directories.  If it can do that job better by handling foo/.
> rather than giving an Invalid argument error, surely that's an improvement?
> 
>   "The meaning of deleting pathname/. is unclear, because the name
>    of the file (directory) in the parent directory to be removed is
>    not clear, particularly in the presence of multiple links to a directory."
> 
> In theory that is true but don't all modern Unix systems disallow creating
> hard links to a directory?  So in practice 'foo/.' is pretty unambiguous.

There are cases with netapps for example where this is not the case.

> But out of interest,
> 
>   "If the path argument refers to a path whose final component
>    is either dot or dot-dot, rmdir() shall fail."
> 
> Does POSIX document the error status that should be returned in these cases?

Yes EINVAL

http://pubs.opengroup.org/onlinepubs/009695399/functions/rmdir.html

cheers,
Pádraig





reply via email to

[Prev in Thread] Current Thread [Next in Thread]