[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug-gnulib] Re: new unlinkdir module for gnulib
From: |
Bruno Haible |
Subject: |
[bug-gnulib] Re: new unlinkdir module for gnulib |
Date: |
Fri, 20 May 2005 14:09:59 +0200 |
User-agent: |
KMail/1.5 |
Paul Eggert wrote:
> I installed this, imported from coreutils. It addresses the issue
> that `unlink ("directory")' works on some hosts (e.g., Solaris,
> OpenBSD) but not others (e.g., GNU/Linux, FreeBSD). Solaris 10 has a
> new wrinkle: you can add/remove the privilege of unlinking a
> directory.
Is it useful to have this in gnulib?
POSIX has a function for removing directories: rmdir().
http://www.opengroup.org/onlinepubs/009695399/functions/rmdir.html
This function is portable. It does not require privileges (other than
those mandated by the directory and its parent directory). It does not
leave garbage on the filesystem.
Reading the comments in
http://savannah.gnu.org/cgi-bin/viewcvs/coreutils/coreutils/src/remove.c?rev=1.126&content-type=text/vnd.viewcvs-markup
it seems that the only use of this function is to speed up the removal of
a non-empty directory.
Why not add to gnulib a module with a function rmdir_recursive() instead?
This function would remove a directory, including its contents.
Bruno