diff --git a/legacy/ecore/src/lib/ecore_file/Ecore_File.h b/legacy/ecore/src/lib/ecore_file/Ecore_File.h index be3aca49a1..b3fa4c6f5c 100644 --- a/legacy/ecore/src/lib/ecore_file/Ecore_File.h +++ b/legacy/ecore/src/lib/ecore_file/Ecore_File.h @@ -56,6 +56,7 @@ extern "C" { EAPI int ecore_file_rmdir (const char *dir); EAPI int ecore_file_mkpath (const char *path); EAPI int ecore_file_cp (const char *src, const char *dst); + EAPI int ecore_file_mv (const char *src, const char *dst); EAPI char *ecore_file_realpath (const char *file); EAPI int ecore_file_unlink (const char *file); EAPI char *ecore_file_get_file (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 eb0ff18aa2..6d71a8426f 100644 --- a/legacy/ecore/src/lib/ecore_file/ecore_file.c +++ b/legacy/ecore/src/lib/ecore_file/ecore_file.c @@ -119,6 +119,14 @@ ecore_file_cp(const char *src, const char *dst) return 1; } +int +ecore_file_mv(const char *src, const char *dst) +{ + if (ecore_file_exists(dst)) return 0; + if (rename(src, dst)) return 0; + return 1; +} + char * ecore_file_realpath(const char *file) {