summaryrefslogtreecommitdiff
path: root/legacy/ecore/src/lib/ecore_file/ecore_file.c
diff options
context:
space:
mode:
authorGustavo Sverzut Barbieri <barbieri@gmail.com>2009-04-11 06:13:02 +0000
committerGustavo Sverzut Barbieri <barbieri@gmail.com>2009-04-11 06:13:02 +0000
commit4467ac1c39eddda223ac491ac2c08b46af0501a7 (patch)
treeb9c0c0f191c99089e1d01369d9765049031f7445 /legacy/ecore/src/lib/ecore_file/ecore_file.c
parentc08930433c38bdd25b7f32a368732826ccada53e (diff)
batch directory creation, part 1.
SVN revision: 39961
Diffstat (limited to '')
-rw-r--r--legacy/ecore/src/lib/ecore_file/ecore_file.c40
1 files changed, 40 insertions, 0 deletions
diff --git a/legacy/ecore/src/lib/ecore_file/ecore_file.c b/legacy/ecore/src/lib/ecore_file/ecore_file.c
index 6efe5e0502..7593e2c3e6 100644
--- a/legacy/ecore/src/lib/ecore_file/ecore_file.c
+++ b/legacy/ecore/src/lib/ecore_file/ecore_file.c
@@ -155,6 +155,25 @@ ecore_file_mkdir(const char *dir)
155} 155}
156 156
157/** 157/**
158 * Create complete directory in a batch.
159 *
160 * @param dirs list of directories, null terminated.
161 * @return number of successfull directories created, -1 if dirs is NULL.
162 *
163 * @see ecore_file_mkdir() and ecore_file_mkpaths()
164 */
165EAPI int
166ecore_file_mkdirs(const char **dirs)
167{
168 if (!dirs) return -1;
169 int i = 0;
170 for (; *dirs != NULL; dirs++)
171 if (ecore_file_mkdir(*dirs))
172 i++;
173 return i;
174}
175
176/**
158 * Delete the given dir 177 * Delete the given dir
159 * @param dir The name of the directory to delete 178 * @param dir The name of the directory to delete
160 * @return 1 on success, 0 on failure 179 * @return 1 on success, 0 on failure
@@ -235,6 +254,8 @@ ecore_file_recursive_rm(const char *dir)
235 * Create a complete path 254 * Create a complete path
236 * @param path The path to create 255 * @param path The path to create
237 * @return 1 on success, 0 on failure 256 * @return 1 on success, 0 on failure
257 *
258 * @see ecore_file_mkpaths() and ecore_file_mkdir()
238 */ 259 */
239EAPI int 260EAPI int
240ecore_file_mkpath(const char *path) 261ecore_file_mkpath(const char *path)
@@ -264,6 +285,25 @@ ecore_file_mkpath(const char *path)
264} 285}
265 286
266/** 287/**
288 * Create complete paths in a batch.
289 *
290 * @param paths list of paths, null terminated.
291 * @return number of successfull paths created, -1 if paths is NULL.
292 *
293 * @see ecore_file_mkpath() and ecore_file_mkdirs()
294 */
295EAPI int
296ecore_file_mkpaths(const char **paths)
297{
298 if (!paths) return -1;
299 int i = 0;
300 for (; *paths != NULL; paths++)
301 if (ecore_file_mkpath(*paths))
302 i++;
303 return i;
304}
305
306/**
267 * Copy a file 307 * Copy a file
268 * @param src The name of the source file 308 * @param src The name of the source file
269 * @param dst The name of the destination file 309 * @param dst The name of the destination file