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.

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?

-- 
Ed Avis <e...@waniasset.com>

Reply via email to