Ecore_File.h File Reference

Files utility functions. More...

Typedefs

typedef struct _Ecore_File_Monitor Ecore_File_Monitor
 Abstract type used when monitoring a directory.
 
typedef struct
_Ecore_File_Download_Job 
Ecore_File_Download_Job
 Abstract type used when aborting a download.
 
typedef enum _Ecore_File_Event Ecore_File_Event
 
typedef void(* Ecore_File_Monitor_Cb )(void *data, Ecore_File_Monitor *em, Ecore_File_Event event, const char *path)
 Callback type used when a monitored directory has changes.
 
typedef void(* Ecore_File_Download_Completion_Cb )(void *data, const char *file, int status)
 Callback type used when a download is finished.
 
typedef enum
_Ecore_File_Progress_Return 
Ecore_File_Progress_Return
 
typedef int(* Ecore_File_Download_Progress_Cb )(void *data, const char *file, long int dltotal, long int dlnow, long int ultotal, long int ulnow)
 Callback type used while a download is in progress.
 

Enumerations

enum  _Ecore_File_Event {
  ECORE_FILE_EVENT_NONE,
  ECORE_FILE_EVENT_CREATED_FILE,
  ECORE_FILE_EVENT_CREATED_DIRECTORY,
  ECORE_FILE_EVENT_DELETED_FILE,
  ECORE_FILE_EVENT_DELETED_DIRECTORY,
  ECORE_FILE_EVENT_DELETED_SELF,
  ECORE_FILE_EVENT_MODIFIED,
  ECORE_FILE_EVENT_CLOSED
}
 The event type returned when a file or directory is monitored. More...
 
enum  _Ecore_File_Progress_Return {
  ECORE_FILE_PROGRESS_CONTINUE = 0,
  ECORE_FILE_PROGRESS_ABORT = 1
}
 What to do with the download as a return from the Ecore_File_Download_Progress_Cb function, if provided. More...
 

Functions

int ecore_file_init ()
 Initialize the Ecore_File library.
 
int ecore_file_shutdown ()
 Shut down the Ecore_File library.
 
long long ecore_file_mod_time (const char *file)
 Get the time of the last modification to the given file.
 
long long ecore_file_size (const char *file)
 Get the size of the given file.
 
Eina_Bool ecore_file_exists (const char *file)
 Check if the given file exists.
 
Eina_Bool ecore_file_is_dir (const char *file)
 Check if the given file is a directory.
 
Eina_Bool ecore_file_mkdir (const char *dir)
 Create a new directory.
 
int ecore_file_mkdirs (const char **dirs)
 Create complete directory in a batch.
 
int ecore_file_mksubdirs (const char *base, const char **subdirs)
 Create complete list of sub-directories in a batch (optimized).
 
Eina_Bool ecore_file_rmdir (const char *dir)
 Delete the given directory.
 
Eina_Bool ecore_file_recursive_rm (const char *dir)
 Delete the given directory and all its contents.
 
Eina_Bool ecore_file_mkpath (const char *path)
 Create a complete path.
 
int ecore_file_mkpaths (const char **paths)
 Create complete paths in a batch.
 
Eina_Bool ecore_file_cp (const char *src, const char *dst)
 Copy the given file to the given destination.
 
Eina_Bool ecore_file_mv (const char *src, const char *dst)
 Move the given file to the given destination.
 
Eina_Bool ecore_file_symlink (const char *src, const char *dest)
 Create a symbolic link.
 
char * ecore_file_realpath (const char *file)
 Get the canonicalized absolute path name.
 
Eina_Bool ecore_file_unlink (const char *file)
 Delete the given file.
 
Eina_Bool ecore_file_remove (const char *file)
 Remove the given file or directory.
 
const char * ecore_file_file_get (const char *path)
 Get the filename from a given path.
 
char * ecore_file_dir_get (const char *file)
 Get the directory where the given file resides.
 
Eina_Bool ecore_file_can_read (const char *file)
 Check if the given file can be read.
 
Eina_Bool ecore_file_can_write (const char *file)
 Check if the given file can be written.
 
Eina_Bool ecore_file_can_exec (const char *file)
 Check if the given file can be executed.
 
char * ecore_file_readlink (const char *lnk)
 Get the path pointed by the given link.
 
Eina_Listecore_file_ls (const char *dir)
 Get the list of the files and directories in the given directory.
 
Eina_Iteratorecore_file_ls_iterator (const char *dir)
 
char * ecore_file_app_exe_get (const char *app)
 Return the executable from the given command.
 
char * ecore_file_escape_name (const char *filename)
 Add the escape sequence ('\') to the given file name.
 
char * ecore_file_strip_ext (const char *path)
 Remove the extension from the given file name.
 
int ecore_file_dir_is_empty (const char *dir)
 Check if the given directory is empty.
 
Ecore_File_Monitorecore_file_monitor_add (const char *path, Ecore_File_Monitor_Cb func, void *data)
 Monitor the given path using inotify, Windows notification, or polling.
 
void ecore_file_monitor_del (Ecore_File_Monitor *em)
 Stop the monitoring of the given path.
 
const char * ecore_file_monitor_path_get (Ecore_File_Monitor *em)
 Get the monitored path.
 
Eina_Bool ecore_file_path_dir_exists (const char *in_dir)
 Check if the given directory is in PATH.
 
Eina_Bool ecore_file_app_installed (const char *exe)
 Check if the given application is installed.
 
Eina_Listecore_file_app_list (void)
 Get a list of all the applications installed on the system.
 
Eina_Bool ecore_file_download (const char *url, const char *dst, Ecore_File_Download_Completion_Cb completion_cb, Ecore_File_Download_Progress_Cb progress_cb, void *data, Ecore_File_Download_Job **job_ret)
 Download the given url to the given destination.
 
Eina_Bool ecore_file_download_full (const char *url, const char *dst, Ecore_File_Download_Completion_Cb completion_cb, Ecore_File_Download_Progress_Cb progress_cb, void *data, Ecore_File_Download_Job **job_ret, Eina_Hash *headers)
 Download the given url to the given destination with additional headers.
 
void ecore_file_download_abort_all (void)
 Abort all downloads.
 
void ecore_file_download_abort (Ecore_File_Download_Job *job)
 Abort the given download job and call the completion_cb callbck with a status of 1 (error).
 
Eina_Bool ecore_file_download_protocol_available (const char *protocol)
 Check if the given protocol is available.
 

Detailed Description

Files utility functions.