This is the core asynchronous input/output operation. More...
Data Structures | |
struct | _Eio_Progress |
Represents the current progress of the operation. More... |
Typedefs | |
typedef enum _Eio_File_Op | Eio_File_Op |
typedef struct _Eio_File | Eio_File |
typedef struct _Eio_Progress | Eio_Progress |
typedef Eina_Bool(* | Eio_Filter_Cb )(void *data, Eio_File *handler, const char *file) |
typedef void(* | Eio_Main_Cb )(void *data, Eio_File *handler, const char *file) |
typedef Eina_Bool(* | Eio_Filter_Direct_Cb )(void *data, Eio_File *handler, const Eina_File_Direct_Info *info) |
typedef Eina_Bool(* | Eio_Filter_Dir_Cb )(void *data, Eio_File *handler, Eina_File_Direct_Info *info) |
typedef void(* | Eio_Main_Direct_Cb )(void *data, Eio_File *handler, const Eina_File_Direct_Info *info) |
typedef void(* | Eio_Stat_Cb )(void *data, Eio_File *handler, const Eina_Stat *stat) |
typedef void(* | Eio_Progress_Cb )(void *data, Eio_File *handler, const Eio_Progress *info) |
typedef void(* | Eio_Eet_Open_Cb )(void *data, Eio_File *handler, Eet_File *file) |
typedef void(* | Eio_Open_Cb )(void *data, Eio_File *handler, Eina_File *file) |
typedef Eina_Bool(* | Eio_Filter_Map_Cb )(void *data, Eio_File *handler, void *map, size_t length) |
typedef void(* | Eio_Map_Cb )(void *data, Eio_File *handler, void *map, size_t length) |
typedef void(* | Eio_Done_Data_Cb )(void *data, Eio_File *handler, const char *read_data, unsigned int size) |
typedef void(* | Eio_Done_String_Cb )(void *data, Eio_File *handler, const char *xattr_string) |
typedef void(* | Eio_Done_Double_Cb )(void *data, Eio_File *handler, double xattr_double) |
typedef void(* | Eio_Done_Int_Cb )(void *data, Eio_File *handler, int i) |
typedef void(* | Eio_Done_ERead_Cb )(void *data, Eio_File *handler, void *decoded) |
typedef void(* | Eio_Done_Read_Cb )(void *data, Eio_File *handler, void *read_data, unsigned int size) |
typedef void(* | Eio_Done_Cb )(void *data, Eio_File *handler) |
typedef void(* | Eio_Error_Cb )(void *data, Eio_File *handler, int error) |
typedef void(* | Eio_Eet_Error_Cb )(void *data, Eio_File *handler, Eet_Error err) |
Enumerations | |
enum | _Eio_File_Op { EIO_FILE_COPY, EIO_FILE_MOVE, EIO_DIR_COPY, EIO_DIR_MOVE, EIO_UNLINK, EIO_FILE_GETPWNAM, EIO_FILE_GETGRNAM } |
Input/Output operations on files. More... |
Functions | |
EAPI Eio_File * | eio_file_ls (const char *dir, Eio_Filter_Cb filter_cb, Eio_Main_Cb main_cb, Eio_Done_Cb done_cb, Eio_Error_Cb error_cb, const void *data) |
List contents of a directory without locking your app. | |
EAPI Eio_File * | eio_file_direct_ls (const char *dir, Eio_Filter_Direct_Cb filter_cb, Eio_Main_Direct_Cb main_cb, Eio_Done_Cb done_cb, Eio_Error_Cb error_cb, const void *data) |
List contents of a directory without locking your app. | |
EAPI Eio_File * | eio_file_stat_ls (const char *dir, Eio_Filter_Direct_Cb filter_cb, Eio_Main_Direct_Cb main_cb, Eio_Done_Cb done_cb, Eio_Error_Cb error_cb, const void *data) |
List content of a directory without locking your app. | |
EAPI Eio_File * | eio_dir_stat_ls (const char *dir, Eio_Filter_Direct_Cb filter_cb, Eio_Main_Direct_Cb main_cb, Eio_Done_Cb done_cb, Eio_Error_Cb error_cb, const void *data) |
List the content of a directory and all it's sub-content asynchronously. | |
EAPI Eio_File * | eio_dir_direct_ls (const char *dir, Eio_Filter_Dir_Cb filter_cb, Eio_Main_Direct_Cb main_cb, Eio_Done_Cb done_cb, Eio_Error_Cb error_cb, const void *data) |
List the content of a directory and all it's sub-content asynchronously. | |
EAPI Eio_File * | eio_file_direct_stat (const char *path, Eio_Stat_Cb done_cb, Eio_Error_Cb error_cb, const void *data) |
Stat a file/directory. | |
EAPI Eio_File * | eio_file_chmod (const char *path, mode_t mode, Eio_Done_Cb done_cb, Eio_Error_Cb error_cb, const void *data) |
Change right of a path. | |
EAPI Eio_File * | eio_file_chown (const char *path, const char *user, const char *group, Eio_Done_Cb done_cb, Eio_Error_Cb error_cb, const void *data) |
Change owner of a path. | |
EAPI Eio_File * | eio_file_unlink (const char *path, Eio_Done_Cb done_cb, Eio_Error_Cb error_cb, const void *data) |
Unlink a file/directory. | |
EAPI Eio_File * | eio_file_mkdir (const char *path, mode_t mode, Eio_Done_Cb done_cb, Eio_Error_Cb error_cb, const void *data) |
Create a new directory. | |
EAPI Eio_File * | eio_file_move (const char *source, const char *dest, Eio_Progress_Cb progress_cb, Eio_Done_Cb done_cb, Eio_Error_Cb error_cb, const void *data) |
Move a file asynchronously. | |
EAPI Eio_File * | eio_file_copy (const char *source, const char *dest, Eio_Progress_Cb progress_cb, Eio_Done_Cb done_cb, Eio_Error_Cb error_cb, const void *data) |
Copy a file asynchronously. | |
EAPI Eio_File * | eio_dir_move (const char *source, const char *dest, Eio_Filter_Direct_Cb filter_cb, Eio_Progress_Cb progress_cb, Eio_Done_Cb done_cb, Eio_Error_Cb error_cb, const void *data) |
Move a directory and it's content asynchronously. | |
EAPI Eio_File * | eio_dir_copy (const char *source, const char *dest, Eio_Filter_Direct_Cb filter_cb, Eio_Progress_Cb progress_cb, Eio_Done_Cb done_cb, Eio_Error_Cb error_cb, const void *data) |
Copy a directory and it's content asynchronously. | |
EAPI Eio_File * | eio_dir_unlink (const char *path, Eio_Filter_Direct_Cb filter_cb, Eio_Progress_Cb progress_cb, Eio_Done_Cb done_cb, Eio_Error_Cb error_cb, const void *data) |
Remove a directory and it's content asynchronously. |
Detailed Description
This is the core asynchronous input/output operation.
All the functions in this group perform input/output operations in a separate thread using the infrastructure provided by Ecore_Thread and Eina, this means that all functions here are non-blocking.
The functions displayed here are used to make basic file operations, like listing the content of a directory, creating a new directory, etc.
Typedef Documentation
Input/Output operations on files.
Generic asynchronous I/O reference.
Progress information on a specific operation.
Enumeration Type Documentation
enum _Eio_File_Op |
Input/Output operations on files.
This enum represents the operations that can be done.
- Enumerator:
Function Documentation
EAPI Eio_File* eio_file_ls | ( | const char * | dir, |
Eio_Filter_Cb | filter_cb, | ||
Eio_Main_Cb | main_cb, | ||
Eio_Done_Cb | done_cb, | ||
Eio_Error_Cb | error_cb, | ||
const void * | data | ||
) |
List contents of a directory without locking your app.
- Parameters
-
dir The directory to list. filter_cb Callback used to decide if the file will be passed to main_cb main_cb Callback called for each listed file if it was not filtered. done_cb Callback called when the ls operation is done. error_cb Callback called when either the directory could not be opened or the operation has been canceled. data Unmodified user data passed to callbacks
- Returns
- A reference to the I/O operation.
This function is responsible for listing the content of a directory without blocking your application. It's equivalent to the "ls" shell command. Every file will be passed to the filter_cb, so it's your job to decide if you want to pass the file to the main_cb or not. Return EINA_TRUE to pass it to the main_cb or EINA_FALSE to ignore it.
EAPI Eio_File* eio_file_direct_ls | ( | const char * | dir, |
Eio_Filter_Direct_Cb | filter_cb, | ||
Eio_Main_Direct_Cb | main_cb, | ||
Eio_Done_Cb | done_cb, | ||
Eio_Error_Cb | error_cb, | ||
const void * | data | ||
) |
List contents of a directory without locking your app.
- Parameters
-
dir The directory to list. filter_cb Callback used to decide if the file will be passed to main_cb main_cb Callback called from the main loop for each accepted file (not filtered). done_cb Callback called from the main loop after the contents of the directory has been listed. error_cb Callback called from the main loop when either the directory could not be opened or the operation has been canceled. data Unmodified user data passed to callbacks
- Returns
- A reference to the I/O operation.
eio_file_direct_ls runs eina_file_direct_ls in a separate thread using ecore_thread_feedback_run. This prevents any blocking in your apps. Every file will be passed to the filter_cb, so it's your job to decide if you want to pass the file to the main_cb or not. Return EINA_TRUE to pass it to the main_cb or EINA_FALSE to ignore it.
EAPI Eio_File* eio_file_stat_ls | ( | const char * | dir, |
Eio_Filter_Direct_Cb | filter_cb, | ||
Eio_Main_Direct_Cb | main_cb, | ||
Eio_Done_Cb | done_cb, | ||
Eio_Error_Cb | error_cb, | ||
const void * | data | ||
) |
List content of a directory without locking your app.
- Parameters
-
dir The directory to list. filter_cb Callback used to decide if the file will be passed to main_cb main_cb Callback called from the main loop for each accepted file (not filtered). done_cb Callback called from the main loop after the contents of the directory has been listed. error_cb Callback called from the main loop when either the directory could not be opened or the operation has been canceled. data Unmodified user data passed to callbacks
- Returns
- A reference to the I/O operation.
Every file will be passed to the filter_cb, so it's your job to decide if you want to pass the file to the main_cb or not. Return EINA_TRUE to pass it to the main_cb or EINA_FALSE to ignore it.
EAPI Eio_File* eio_dir_stat_ls | ( | const char * | dir, |
Eio_Filter_Direct_Cb | filter_cb, | ||
Eio_Main_Direct_Cb | main_cb, | ||
Eio_Done_Cb | done_cb, | ||
Eio_Error_Cb | error_cb, | ||
const void * | data | ||
) |
List the content of a directory and all it's sub-content asynchronously.
- Parameters
-
dir The directory to list. filter_cb Callback used to decide if the file will be passed to main_cb main_cb Callback called from the main loop for each accepted file (not filtered). done_cb Callback called from the main loop after the contents of the directory has been listed. error_cb Callback called from the main loop when either the directory could not be opened or the operation has been canceled. data Unmodified user data passed to callbacks
- Returns
- A reference to the I/O operation.
eio_dir_stat_ls() runs eina_file_stat_ls() recursively in a separate thread using ecore_thread_feedback_run. This prevents any blocking in your apps. Every file will be passed to the filter_cb, so it's your job to decide if you want to pass the file to the main_cb or not. Return EINA_TRUE to pass it to the main_cb or EINA_FALSE to ignore it.
EAPI Eio_File* eio_dir_direct_ls | ( | const char * | dir, |
Eio_Filter_Dir_Cb | filter_cb, | ||
Eio_Main_Direct_Cb | main_cb, | ||
Eio_Done_Cb | done_cb, | ||
Eio_Error_Cb | error_cb, | ||
const void * | data | ||
) |
List the content of a directory and all it's sub-content asynchronously.
- Parameters
-
dir The directory to list. filter_cb Callback used to decide if the file will be passed to main_cb main_cb Callback called from the main loop for each accepted file (not filtered). done_cb Callback called from the main loop after the contents of the directory has been listed. error_cb Callback called from the main loop when either the directory could not be opened or the operation has been canceled. data Unmodified user data passed to callbacks
- Returns
- A reference to the I/O operation.
eio_dir_direct_ls() runs eina_file_direct_ls() recursively in a separate thread using ecore_thread_feedback_run. This prevents any blocking in your apps. Every file will be passed to the filter_cb, so it's your job to decide if you want to pass the file to the main_cb or not. Return EINA_TRUE to pass it to the main_cb or EINA_FALSE to ignore it.
EAPI Eio_File* eio_file_direct_stat | ( | const char * | path, |
Eio_Stat_Cb | done_cb, | ||
Eio_Error_Cb | error_cb, | ||
const void * | data | ||
) |
Stat a file/directory.
- Parameters
-
path The path to stat. done_cb Callback called from the main loop when stat was successfully called. error_cb Callback called from the main loop when stat failed or has been canceled. data Unmodified user data passed to callbacks
- Returns
- A reference to the I/O operation.
eio_file_direct_stat calls stat in another thread. This prevents any blocking in your apps.
EAPI Eio_File* eio_file_chmod | ( | const char * | path, |
mode_t | mode, | ||
Eio_Done_Cb | done_cb, | ||
Eio_Error_Cb | error_cb, | ||
const void * | data | ||
) |
Change right of a path.
- Parameters
-
path The directory path to change access right. mode The permission to set, follow (mode & ~umask & 0777). done_cb Callback called when the operation is completed. error_cb Callback called from if something goes wrong. data Unmodified user data passed to callbacks.
- Returns
- A reference to the I/O operation.
Set a new permission of a path changing it to the mode passed as argument. It's equivalent to the chmod command.
EAPI Eio_File* eio_file_chown | ( | const char * | path, |
const char * | user, | ||
const char * | group, | ||
Eio_Done_Cb | done_cb, | ||
Eio_Error_Cb | error_cb, | ||
const void * | data | ||
) |
Change owner of a path.
- Parameters
-
path The directory path to change owner. user The new user to set (can be NULL). group The new group to set (can be NULL). done_cb Callback called when the operation is completed. error_cb Callback called from if something goes wrong. data Unmodified user data passed to callbacks
- Returns
- A reference to the I/O operation.
This function will change the owner of a path, setting it to the user and group passed as argument. It's equivalent to the chown shell command.
EAPI Eio_File* eio_file_unlink | ( | const char * | path, |
Eio_Done_Cb | done_cb, | ||
Eio_Error_Cb | error_cb, | ||
const void * | data | ||
) |
Unlink a file/directory.
- Parameters
-
path The path to unlink. done_cb Callback called when the operation is completed. error_cb Callback called from if something goes wrong. data Unmodified user data passed to callbacks.
- Returns
- A reference to the I/O operation.
This function will erase a file.
EAPI Eio_File* eio_file_mkdir | ( | const char * | path, |
mode_t | mode, | ||
Eio_Done_Cb | done_cb, | ||
Eio_Error_Cb | error_cb, | ||
const void * | data | ||
) |
Create a new directory.
- Parameters
-
path The directory path to create. mode The permission to set, follow (mode & ~umask & 0777). done_cb Callback called when the operation is completed. error_cb Callback called from if something goes wrong. data Unmodified user data passed to callbacks
- Returns
- A reference to the I/O operation.
Creates a new directory using the mode provided.
EAPI Eio_File* eio_file_move | ( | const char * | source, |
const char * | dest, | ||
Eio_Progress_Cb | progress_cb, | ||
Eio_Done_Cb | done_cb, | ||
Eio_Error_Cb | error_cb, | ||
const void * | data | ||
) |
Move a file asynchronously.
- Parameters
-
source Should be the name of the file to move the data from. dest Should be the name of the file to move the data to. progress_cb Callback called to know the progress of the move. done_cb Callback called when the move is done. error_cb Callback called when something goes wrong. data Unmodified user data passed to callbacks
This function will copy a file from source to dest. It will try to use splice if possible, if not it will fallback to mmap/write. It will try to preserve access right, but not user/group identification.
EAPI Eio_File* eio_file_copy | ( | const char * | source, |
const char * | dest, | ||
Eio_Progress_Cb | progress_cb, | ||
Eio_Done_Cb | done_cb, | ||
Eio_Error_Cb | error_cb, | ||
const void * | data | ||
) |
Copy a file asynchronously.
- Parameters
-
source Should be the name of the file to copy the data from. dest Should be the name of the file to copy the data to. progress_cb Callback called to know the progress of the copy. done_cb Callback called when the copy is done. error_cb Callback called when something goes wrong. data Unmodified user data passed to callbacks
This function will copy a file from source to dest. It will try to use splice if possible, if not it will fallback to mmap/write. It will try to preserve access right, but not user/group identification.
EAPI Eio_File* eio_dir_move | ( | const char * | source, |
const char * | dest, | ||
Eio_Filter_Direct_Cb | filter_cb, | ||
Eio_Progress_Cb | progress_cb, | ||
Eio_Done_Cb | done_cb, | ||
Eio_Error_Cb | error_cb, | ||
const void * | data | ||
) |
Move a directory and it's content asynchronously.
- Parameters
-
source Should be the name of the directory to copy the data from. dest Should be the name of the directory to copy the data to. filter_cb Possible to deny the move of some files/directories. progress_cb Callback called to know the progress of the copy. done_cb Callback called when the copy is done. error_cb Callback called when something goes wrong. data Unmodified user data passed to callbacks
This function will move a directory and all it's content from source to dest. It will try first to rename the directory, if not it will try to use splice if possible, if not it will fallback to mmap/write. It will try to preserve access right, but not user/group identity. Every file will be passed to the filter_cb, so it's your job to decide if you want to pass the file to the main_cb or not. Return EINA_TRUE to pass it to the main_cb or EINA_FALSE to ignore it.
- Note
- if a rename occur, the filter callback will not be called.
EAPI Eio_File* eio_dir_copy | ( | const char * | source, |
const char * | dest, | ||
Eio_Filter_Direct_Cb | filter_cb, | ||
Eio_Progress_Cb | progress_cb, | ||
Eio_Done_Cb | done_cb, | ||
Eio_Error_Cb | error_cb, | ||
const void * | data | ||
) |
Copy a directory and it's content asynchronously.
- Parameters
-
source Should be the name of the directory to copy the data from. dest Should be the name of the directory to copy the data to. filter_cb Possible to deny the move of some files/directories. progress_cb Callback called to know the progress of the copy. done_cb Callback called when the copy is done. error_cb Callback called when something goes wrong. data Unmodified user data passed to callbacks
This function will copy a directory and all it's content from source to dest. It will try to use splice if possible, if not it will fallback to mmap/write. It will try to preserve access right, but not user/group identity. Every file will be passed to the filter_cb, so it's your job to decide if you want to pass the file to the main_cb or not. Return EINA_TRUE to pass it to the main_cb or EINA_FALSE to ignore it.
EAPI Eio_File* eio_dir_unlink | ( | const char * | path, |
Eio_Filter_Direct_Cb | filter_cb, | ||
Eio_Progress_Cb | progress_cb, | ||
Eio_Done_Cb | done_cb, | ||
Eio_Error_Cb | error_cb, | ||
const void * | data | ||
) |
Remove a directory and it's content asynchronously.
- Parameters
-
path Should be the name of the directory to destroy. filter_cb Possible to deny the move of some files/directories. progress_cb Callback called to know the progress of the copy. done_cb Callback called when the copy is done. error_cb Callback called when something goes wrong. data Unmodified user data passed to callbacks
This function will remove a directory and all it's content. Every file will be passed to the filter_cb, so it's your job to decide if you want to pass the file to the main_cb or not. Return EINA_TRUE to pass it to the main_cb or EINA_FALSE to ignore it.