6 * - More events, move/rename of directory file
16 # ifdef EFL_ECORE_FILE_BUILD
18 # define EAPI __declspec(dllexport)
21 # endif /* ! DLL_EXPORT */
23 # define EAPI __declspec(dllimport)
24 # endif /* ! EFL_ECORE_FILE_BUILD */
28 # define EAPI __attribute__ ((visibility("default")))
39 * @brief Files utility functions
47 * @defgroup Ecore_File_Group Ecore_File - Files and direcotries convenience functions
53 * @typedef Ecore_File_Monitor
54 * Abstract type used when monitoring a directory.
56 typedef struct _Ecore_File_Monitor Ecore_File_Monitor;
59 * @typedef Ecore_File_Download_Job
60 * Abstract type used when aborting a download.
62 typedef struct _Ecore_File_Download_Job Ecore_File_Download_Job;
65 * @typedef Ecore_File_Event
66 * The event type returned when a file or directory is monitored.
68 typedef enum _Ecore_File_Event
70 ECORE_FILE_EVENT_NONE, /**< No event. */
71 ECORE_FILE_EVENT_CREATED_FILE, /**< Created file event. */
72 ECORE_FILE_EVENT_CREATED_DIRECTORY, /**< Created directory event. */
73 ECORE_FILE_EVENT_DELETED_FILE, /**< Deleted file event. */
74 ECORE_FILE_EVENT_DELETED_DIRECTORY, /**< Deleted directory event. */
75 ECORE_FILE_EVENT_DELETED_SELF, /**< Deleted monitored directory event. */
76 ECORE_FILE_EVENT_MODIFIED /**< Modified file or directory event. */
80 * @typedef Ecore_File_Monitor_Cb
81 * Callback type used when a monitored directory has changes.
83 typedef void (*Ecore_File_Monitor_Cb)(void *data, Ecore_File_Monitor *em, Ecore_File_Event event, const char *path);
86 * @typedef Ecore_File_Download_Completion_Cb
87 * Callback type used when a download is finished.
89 typedef void (*Ecore_File_Download_Completion_Cb)(void *data, const char *file, int status);
92 * @typedef Ecore_File_Download_Progress_Cb
93 * Callback type used when a download is finished.
95 typedef int (*Ecore_File_Download_Progress_Cb)(void *data,
102 /* File operations */
104 EAPI int ecore_file_init (void);
105 EAPI int ecore_file_shutdown (void);
106 EAPI long long ecore_file_mod_time (const char *file);
107 EAPI long long ecore_file_size (const char *file);
108 EAPI Eina_Bool ecore_file_exists (const char *file);
109 EAPI Eina_Bool ecore_file_is_dir (const char *file);
110 EAPI Eina_Bool ecore_file_mkdir (const char *dir);
111 EAPI int ecore_file_mkdirs (const char **dirs);
112 EAPI int ecore_file_mksubdirs (const char *base, const char **subdirs);
113 EAPI Eina_Bool ecore_file_rmdir (const char *dir);
114 EAPI Eina_Bool ecore_file_recursive_rm (const char *dir);
115 EAPI Eina_Bool ecore_file_mkpath (const char *path);
116 EAPI int ecore_file_mkpaths (const char **paths);
117 EAPI Eina_Bool ecore_file_cp (const char *src, const char *dst);
118 EAPI Eina_Bool ecore_file_mv (const char *src, const char *dst);
119 EAPI Eina_Bool ecore_file_symlink (const char *src, const char *dest);
120 EAPI char *ecore_file_realpath (const char *file);
121 EAPI Eina_Bool ecore_file_unlink (const char *file);
122 EAPI Eina_Bool ecore_file_remove (const char *file);
123 EAPI const char *ecore_file_file_get (const char *path);
124 EAPI char *ecore_file_dir_get (const char *path);
125 EAPI Eina_Bool ecore_file_can_read (const char *file);
126 EAPI Eina_Bool ecore_file_can_write (const char *file);
127 EAPI Eina_Bool ecore_file_can_exec (const char *file);
128 EAPI char *ecore_file_readlink (const char *link);
129 EAPI Eina_List *ecore_file_ls (const char *dir);
130 EAPI Eina_Iterator *ecore_file_ls_iterator (const char *dir);
131 EAPI char *ecore_file_app_exe_get (const char *app);
132 EAPI char *ecore_file_escape_name (const char *filename);
133 EAPI char *ecore_file_strip_ext (const char *file);
134 EAPI int ecore_file_dir_is_empty (const char *dir);
138 EAPI Ecore_File_Monitor *ecore_file_monitor_add(const char *path,
139 Ecore_File_Monitor_Cb func,
141 EAPI void ecore_file_monitor_del(Ecore_File_Monitor *ecore_file_monitor);
142 EAPI const char *ecore_file_monitor_path_get(Ecore_File_Monitor *ecore_file_monitor);
146 EAPI Eina_Bool ecore_file_path_dir_exists(const char *in_dir);
147 EAPI Eina_Bool ecore_file_app_installed(const char *exe);
148 EAPI Eina_List *ecore_file_app_list(void);
152 EAPI Eina_Bool ecore_file_download(const char *url,
154 Ecore_File_Download_Completion_Cb completion_cb,
155 Ecore_File_Download_Progress_Cb progress_cb,
157 Ecore_File_Download_Job **job_ret);
158 EAPI void ecore_file_download_abort_all(void);
159 EAPI void ecore_file_download_abort(Ecore_File_Download_Job *job);
160 EAPI Eina_Bool ecore_file_download_protocol_available(const char *protocol);