Ecore_File (3) - Linux Manuals
Ecore_File: Files utility functions.
NAME
Ecore_File.h - Files utility functions.
SYNOPSIS
Functions
EAPI int ecore_file_init (void)
Initialize Ecore_File and the services it will use.
EAPI int ecore_file_shutdown (void)
Shutdown the Ecore_File.
EAPI long long ecore_file_mod_time (const char *file)
Get the time of the last modification to the give file.
EAPI long long ecore_file_size (const char *file)
Get the size of the given file.
EAPI int ecore_file_exists (const char *file)
Check if file exists.
EAPI int ecore_file_is_dir (const char *file)
Check if file is a directory.
EAPI int ecore_file_mkdir (const char *dir)
Create a new directory.
EAPI int ecore_file_rmdir (const char *dir)
Delete the given dir.
EAPI int ecore_file_recursive_rm (const char *dir)
Delete a directory and all its contents.
EAPI int ecore_file_mkpath (const char *path)
Create a complete path.
EAPI int ecore_file_cp (const char *src, const char *dst)
Copy a file.
EAPI int ecore_file_mv (const char *src, const char *dst)
Move a file.
EAPI int ecore_file_symlink (const char *src, const char *dest)
Create a symbolic link.
EAPI char * ecore_file_realpath (const char *file)
Get the canonicalized absolute pathname.
EAPI int ecore_file_unlink (const char *file)
Delete the given file.
EAPI const char * ecore_file_file_get (const char *path)
Get the filename from a give path.
EAPI char * ecore_file_dir_get (const char *path)
Get the directory where file reside.
EAPI int ecore_file_can_read (const char *file)
Check if file can be read.
EAPI int ecore_file_can_write (const char *file)
Check if file can be written.
EAPI int ecore_file_can_exec (const char *file)
Check if file can be executed.
EAPI char * ecore_file_readlink (const char *link)
Get the path pointed by link.
EAPI Ecore_List * ecore_file_ls (const char *dir)
Get the list of the files and directories in a given directory.
EAPI char * ecore_file_app_exe_get (const char *app)
FIXME: To be documented.
EAPI char * ecore_file_escape_name (const char *filename)
Add the escape sequence ('\') to the given filename.
EAPI char * ecore_file_strip_ext (const char *file)
Remove the extension from a given path.
EAPI int ecore_file_dir_is_empty (const char *dir)
Check if the given directory is empty.
EAPI Ecore_File_Monitor * ecore_file_monitor_add (const char *path, void(*func)(void *data, Ecore_File_Monitor *em, Ecore_File_Event event, const char *path), void *data)
Monitor a path using inotify or polling.
EAPI void ecore_file_monitor_del (Ecore_File_Monitor *ecore_file_monitor)
Stop monitoring a path.
EAPI const char * ecore_file_monitor_path_get (Ecore_File_Monitor *ecore_file_monitor)
Get the monitored path.
EAPI int ecore_file_path_dir_exists (const char *in_dir)
Check if the given directory is in PATH.
EAPI int ecore_file_app_installed (const char *exe)
Check if the given application is installed.
EAPI Ecore_List * ecore_file_app_list (void)
Get a list of all the applications installed on the system.
EAPI int ecore_file_download (const char *url, const char *dst, void(*completion_cb)(void *data, const char *file, int status), int(*progress_cb)(void *data, const char *file, long int dltotal, long int dlnow, long int ultotal, long int ulnow), void *data)
Download url to the given dst.
EAPI int ecore_file_download_protocol_available (const char *protocol)
Check if the given protocol is available.
Detailed Description
Files utility functions.
Function Documentation
EAPI int ecore_file_app_installed (const char * exe)
Check if the given application is installed.
Parameters:
- exe The name of the application
Returns:
- 1 if the exe is in PATH and is executable
This function check if the given name exist in PATH and is executable
References ecore_file_app_installed(), ecore_list_first_goto(), and ecore_list_next().
Referenced by ecore_file_app_installed().
EAPI Ecore_List* ecore_file_app_list (void)
Get a list of all the applications installed on the system.
Returns:
- An Ecore_List containing all the executable files in the system
References ecore_file_app_list(), ecore_list_append(), ecore_list_destroy(), ecore_list_first_goto(), ecore_list_free_cb_set(), ecore_list_new(), and ecore_list_next().
Referenced by ecore_file_app_list().
EAPI int ecore_file_can_exec (const char * file)
Check if file can be executed.
Parameters:
- file The name of the file
Returns:
- 1 if the file can be executed, 0 otherwise
EAPI int ecore_file_can_read (const char * file)
Check if file can be read.
Parameters:
- file The name of the file
Returns:
- 1 if the file is readable, 0 otherwise
EAPI int ecore_file_can_write (const char * file)
Check if file can be written.
Parameters:
- file The name of the file
Returns:
- 1 if the file is writable, 0 otherwise
EAPI int ecore_file_cp (const char * src, const char * dst)
Copy a file.
Parameters:
-
src The name of the source file
dst The name of the destination file
Returns:
- 1 on success, 0 on failure
EAPI char* ecore_file_dir_get (const char * file)
Get the directory where file reside.
Parameters:
- file The name of the file
Returns:
- The directory name
EAPI int ecore_file_dir_is_empty (const char * dir)
Check if the given directory is empty.
The '.' and '..' files will be ignored.
Parameters:
- dir The name of the directory to check
Returns:
- 1 if directory is empty, 0 if it has at least one file or -1 in case of errors
EAPI int ecore_file_download (const char * url, const char * dst, void(*)(void *data, const char *file, int status) completion_cb, int(*)(void *data, const char *file, long int dltotal, long int dlnow, long int ultotal, long int ulnow) progress_cb, void * data)
Download url to the given dst.
Parameters:
-
url The complete url to download
dst The local file to save the downloaded to
completion_cb A callback called on download complete
progress_cb A callback called during the download operation
Returns:
- 1 if the download start or 0 on failure
You must provide the full url, including 'http://', 'ftp://' or 'file://'.
References ecore_file_download().
Referenced by ecore_file_download().
Check if the given protocol is available.
Parameters:
Returns:
protocol can be 'http://', 'ftp://' or 'file://'.
References ecore_file_download_protocol_available().
Referenced by ecore_file_download_protocol_available().
Add the escape sequence ('\') to the given filename.
Parameters:
Returns:
Check if file exists.
Parameters:
Returns:
Get the filename from a give path.
Parameters:
Returns:
Initialize Ecore_File and the services it will use.
Call this function once before you use any of the ecore file functions.
Returns:
Check if file is a directory.
Parameters:
Returns:
Get the list of the files and directories in a given directory.
The list will be sorted with strcoll as compare function. That means that you may want to set the current locale for the category LC_COLLATE with setlocale(). For more information see the manual pages of strcoll and setlocale. The list will not contain the directory entries for '.' and '..'.
Parameters:
Returns:
References ecore_list_append(), ecore_list_first_goto(), ecore_list_free_cb_set(), ecore_list_new(), and ecore_list_sort().
Create a new directory.
Parameters:
Returns:
The directory is created with the mode: S_IRUSR | S_IWUSR | S_IXUSR | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH
Create a complete path.
Parameters:
Returns:
Get the time of the last modification to the give file.
Parameters:
Returns:
Monitor a path using inotify or polling.
Parameters:
Returns:
References ecore_file_monitor_add().
Referenced by ecore_file_monitor_add().
Stop monitoring a path.
Parameters:
References ecore_file_monitor_del().
Referenced by ecore_file_monitor_del().
Get the monitored path.
Parameters:
Returns:
References ecore_file_monitor_path_get().
Referenced by ecore_file_monitor_path_get().
Move a file.
Parameters:
Returns:
Check if the given directory is in PATH.
Parameters:
Returns:
References ecore_file_path_dir_exists(), ecore_list_first_goto(), and ecore_list_next().
Referenced by ecore_file_path_dir_exists().
Get the path pointed by link.
Parameters:
Returns:
Get the canonicalized absolute pathname.
Parameters:
Returns:
Delete a directory and all its contents.
Parameters:
Returns:
If dir is a link only the link is removed
Delete the given dir.
Parameters:
Returns:
Shutdown the Ecore_File.
Returns:
Get the size of the given file.
Parameters:
Returns:
Remove the extension from a given path.
Parameters:
Returns:
Create a symbolic link.
Parameters:
Returns:
Delete the given file.
Parameters:
Returns:
Generated automatically by Doxygen for Ecore from the source code.
EAPI int ecore_file_download_protocol_available (const char * protocol)
EAPI char* ecore_file_escape_name (const char * filename)
EAPI int ecore_file_exists (const char * file)
EAPI const char* ecore_file_file_get (const char * path)
EAPI int ecore_file_init (void)
EAPI int ecore_file_is_dir (const char * file)
EAPI Ecore_List* ecore_file_ls (const char * dir)
EAPI int ecore_file_mkdir (const char * dir)
EAPI int ecore_file_mkpath (const char * path)
EAPI long long ecore_file_mod_time (const char * file)
EAPI Ecore_File_Monitor* ecore_file_monitor_add (const char * path, void(*)(void *data, Ecore_File_Monitor *em, Ecore_File_Event event, const char *path) func, void * data)
func The function to call on changes
data The data passed to func
EAPI void ecore_file_monitor_del (Ecore_File_Monitor * em)
EAPI const char* ecore_file_monitor_path_get (Ecore_File_Monitor * em)
EAPI int ecore_file_mv (const char * src, const char * dst)
dst The name of the destination file
EAPI int ecore_file_path_dir_exists (const char * in_dir)
EAPI char* ecore_file_readlink (const char * link)
EAPI char* ecore_file_realpath (const char * file)
EAPI int ecore_file_recursive_rm (const char * dir)
EAPI int ecore_file_rmdir (const char * dir)
EAPI int ecore_file_shutdown (void)
EAPI long long ecore_file_size (const char * file)
EAPI char* ecore_file_strip_ext (const char * path)
EAPI int ecore_file_symlink (const char * src, const char * dest)
dest The name of link
EAPI int ecore_file_unlink (const char * file)
Author