bug-gnulib
[Top][All Lists]
Advanced

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

[bug-gnulib] Re: new unlinkdir module for gnulib


From: Paul Eggert
Subject: [bug-gnulib] Re: new unlinkdir module for gnulib
Date: Fri, 20 May 2005 10:22:07 -0700
User-agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.4 (gnu/linux)

Bruno Haible <address@hidden> writes:

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

It has other uses, too.  For example, tar uses it to efficiently
remove non-directories while leaving directories alone.  Pleas see
<http://lists.gnu.org/archive/html/bug-tar/2005-05/msg00023.html> for
the patch and
<http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/tar/tar/src/misc.c?rev=HEAD&content-type=text/plain>
for the context.

> Why not add to gnulib a module with a function rmdir_recursive() instead?
> This function would remove a directory, including its contents.

I'd like that too, but it would be some work.  Tar's remove_any_file
function (which would be one candidate for rmdir_recursive) has two
options and I suspect other programs would need more.  As Jim
mentioned, the error-handling issues are a bit of a pain to get
"right" for arbitrary programs.




reply via email to

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