Bruno Haible <[EMAIL PROTECTED]> 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. _______________________________________________ bug-gnulib mailing list bug-gnulib@gnu.org http://lists.gnu.org/mailman/listinfo/bug-gnulib