summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/eina/eina_file.c10
-rw-r--r--src/lib/eina/eina_file_win32.c24
2 files changed, 34 insertions, 0 deletions
diff --git a/src/lib/eina/eina_file.c b/src/lib/eina/eina_file.c
index cb29f28..c378ea5 100644
--- a/src/lib/eina/eina_file.c
+++ b/src/lib/eina/eina_file.c
@@ -898,6 +898,16 @@ eina_file_refresh(Eina_File *file)
898 return r; 898 return r;
899} 899}
900 900
901EAPI Eina_Bool
902eina_file_unlink(const char *pathname)
903{
904 if ( unlink(pathname) < 0)
905 {
906 return EINA_FALSE;
907 }
908 return EINA_TRUE;
909}
910
901EAPI void * 911EAPI void *
902eina_file_map_all(Eina_File *file, Eina_File_Populate rule) 912eina_file_map_all(Eina_File *file, Eina_File_Populate rule)
903{ 913{
diff --git a/src/lib/eina/eina_file_win32.c b/src/lib/eina/eina_file_win32.c
index 54b5d90..fe83c67 100644
--- a/src/lib/eina/eina_file_win32.c
+++ b/src/lib/eina/eina_file_win32.c
@@ -821,6 +821,30 @@ eina_file_open(const char *path, Eina_Bool shared)
821 return NULL; 821 return NULL;
822} 822}
823 823
824EAPI Eina_Bool
825eina_file_unlink(const char *pathname)
826{
827 char *unlink_path = eina_file_path_sanitize(pathname);
828 Eina_File *file = eina_hash_find(_eina_file_cache, unlink_path);
829
830 if (file)
831 {
832 if (file->handle != INVALID_HANDLE_VALUE)
833 {
834 CloseHandle(file->handle);
835 file->handle = INVALID_HANDLE_VALUE;
836 }
837 }
838
839 if ( unlink(unlink_path) < 0)
840 {
841 return EINA_FALSE;
842 }
843
844 return EINA_TRUE;
845}
846
847
824EAPI Eina_Iterator *eina_file_xattr_get(Eina_File *file EINA_UNUSED) 848EAPI Eina_Iterator *eina_file_xattr_get(Eina_File *file EINA_UNUSED)
825{ 849{
826 return NULL; 850 return NULL;