apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Colm MacCarthaigh <c...@stdlib.net>
Subject Enforce rmdir-like behaviour in apr_dir_remove
Date Mon, 08 Aug 2005 11:30:12 GMT

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

Mime
View raw message