You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@apr.apache.org by Colm MacCarthaigh <co...@stdlib.net> on 2005/08/08 13:30:12 UTC
Enforce rmdir-like behaviour in apr_dir_remove
Currently, if I've checked the beos and win32 API's correctly,
apr_dir_remove will not remove non-empty directories. I know I've come
accross systems in the past which only had recursive RemoveDirectory
system calls, so I wasn't comfortable using the APR call without a
guarantee that non-recursive behaviour is what is expected.
"directory_remove" is ambiguous and could mean either type of behaviour.
I think a guarantee of rmdir() like behaviour is implied, and probably
expected, but having it explicit would be nice so obsessives can make
some modifications free of paranoid forwards-portability guilt.
Index: include/apr_file_io.h
===================================================================
--- include/apr_file_io.h (revision 171000)
+++ include/apr_file_io.h (working copy)
@@ -715,7 +715,8 @@
apr_pool_t *pool);
/**
- * Remove directory from the file system.
+ * Remove directory from the file system. Honours classic rmdir() behaviour
+ * and will not remove a non-empty directory.
* @param path the path for the directory to be removed. (use / on all
* systems)
* @param pool the pool to use.
*/
--
Colm MacCárthaigh Public Key: colm+pgp@stdlib.net