From 5cffd43943bab95751b84dc5123c1f90695c7442 Mon Sep 17 00:00:00 2001 From: Vincent Torri Date: Sat, 19 Dec 2009 19:09:37 +0000 Subject: [PATCH] add a wrapper around remove() SVN revision: 44578 --- legacy/ecore/src/lib/ecore_file/Ecore_File.h | 1 + legacy/ecore/src/lib/ecore_file/ecore_file.c | 12 ++++++++++++ 2 files changed, 13 insertions(+) diff --git a/legacy/ecore/src/lib/ecore_file/Ecore_File.h b/legacy/ecore/src/lib/ecore_file/Ecore_File.h index 4f23697..4d22470 100644 --- a/legacy/ecore/src/lib/ecore_file/Ecore_File.h +++ b/legacy/ecore/src/lib/ecore_file/Ecore_File.h @@ -81,6 +81,7 @@ extern "C" { EAPI int ecore_file_symlink (const char *src, const char *dest); EAPI char *ecore_file_realpath (const char *file); EAPI int ecore_file_unlink (const char *file); + EAPI int ecore_file_remove (const char *file); EAPI const char *ecore_file_file_get (const char *path); EAPI char *ecore_file_dir_get (const char *path); diff --git a/legacy/ecore/src/lib/ecore_file/ecore_file.c b/legacy/ecore/src/lib/ecore_file/ecore_file.c index 064016a..318d6ff 100644 --- a/legacy/ecore/src/lib/ecore_file/ecore_file.c +++ b/legacy/ecore/src/lib/ecore_file/ecore_file.c @@ -296,6 +296,18 @@ ecore_file_unlink(const char *file) } /** + * Remove the given file or directory + * @param file The name of the file or directory to delete + * @return 1 on success, 0 on failure + */ +EAPI int +ecore_file_remove(const char *file) +{ + if (remove(file) < 0) return 0; + return 1; +} + +/** * Delete a directory and all its contents * @param dir The name of the directory to delete * @return 1 on success, 0 on failure -- 2.7.4