Tizen Native API  7.0
Eio file management API.

A set of function to manage file asynchronously.

The function provided by this API are the one useful for any file manager. Like moving or copying a file, unlinking it, changing it's access right, ...

Functions

Eio_Fileeio_file_chmod (const char *path, mode_t mode, Eio_Done_Cb done_cb, Eio_Error_Cb error_cb, const void *data)
 Change rights of a path.
Eio_Fileeio_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.
Eio_Fileeio_file_unlink (const char *path, Eio_Done_Cb done_cb, Eio_Error_Cb error_cb, const void *data)
 Unlink a file/directory.
Eio_Fileeio_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.
Eio_Fileeio_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.
Eio_Fileeio_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.
Eio_Fileeio_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 its content asynchronously.
Eio_Fileeio_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 its content asynchronously.
Eio_Fileeio_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 its content asynchronously.

Function Documentation

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 its content asynchronously.

Parameters:
sourceShould be the name of the directory to copy the data from.
destShould be the name of the directory to copy the data to.
filter_cbPossible to deny the move of some files/directories.
progress_cbCallback called to know the progress of the copy.
done_cbCallback called when the copy is done.
error_cbCallback called when something goes wrong.
dataUnmodified user data passed to callbacks
Returns:
A reference to the I/O operation.
an Eio_File pointer, handler to the copy operation, can be used to cancel the operation

This function will copy a directory and all its 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 rights, 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.

Since :
3.0
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 its content asynchronously.

Parameters:
sourceShould be the name of the directory to copy the data from.
destShould be the name of the directory to copy the data to.
filter_cbPossible to deny the move of some files/directories.
progress_cbCallback called to know the progress of the copy.
done_cbCallback called when the copy is done.
error_cbCallback called when something goes wrong.
dataUnmodified user data passed to callbacks
Returns:
A reference to the I/O operation.
an Eio_File pointer, handler to the move operation, can be used to cancel the operation

This function will move a directory and all its 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 rights, 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 occurs, the filter callback will not be called.
Since :
3.0
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 its content asynchronously.

Parameters:
pathShould be the name of the directory to destroy.
filter_cbPossible to deny the move of some files/directories.
progress_cbCallback called to know the progress of the copy.
done_cbCallback called when the copy is done.
error_cbCallback called when something goes wrong.
dataUnmodified user data passed to callbacks
Returns:
A reference to the I/O operation.
an Eio_File pointer, handler to the unlink operation, can be used to cancel the operation

This function will remove a directory and all its 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.

Since :
3.0
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 rights of a path.

Parameters:
pathThe directory path to change access rights.
modeThe permission to set, follow (mode & ~umask & 0777).
done_cbCallback called when the operation is completed.
error_cbCallback called from if something goes wrong.
dataUnmodified 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.

Since :
3.0
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:
pathThe directory path to change owner.
userThe new user to set (can be NULL).
groupThe new group to set (can be NULL).
done_cbCallback called when the operation is completed.
error_cbCallback called from if something goes wrong.
dataUnmodified 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.

Note:
Some platforms (including Windows) do not support chown(). In that case, this function returns NULL.
Since :
3.0
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:
sourceShould be the name of the file to copy the data from.
destShould be the name of the file to copy the data to.
progress_cbCallback called to know the progress of the copy.
done_cbCallback called when the copy is done.
error_cbCallback called when something goes wrong.
dataUnmodified user data passed to callbacks
Returns:
an Eio_File pointer, handler to the copy operation, can be used to cancel the operation

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 rights, but not user/group identification.

Since :
3.0
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:
pathThe directory path to create.
modeThe permission to set, follow (mode & ~umask & 0777).
done_cbCallback called when the operation is completed.
error_cbCallback called from if something goes wrong.
dataUnmodified user data passed to callbacks
Returns:
A reference to the I/O operation.

Creates a new directory using the mode provided.

Since :
3.0
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:
sourceShould be the name of the file to move the data from.
destShould be the name of the file to move the data to.
progress_cbCallback called to know the progress of the move.
done_cbCallback called when the move is done.
error_cbCallback called when something goes wrong.
dataUnmodified user data passed to callbacks
Returns:
A reference to the I/O operation.
an Eio_File pointer, handler to the move operation, can be used to cancel the operation

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 rights, but not user/group identification.

Since :
3.0
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:
pathThe path to unlink.
done_cbCallback called when the operation is completed.
error_cbCallback called from if something goes wrong.
dataUnmodified user data passed to callbacks.
Returns:
A reference to the I/O operation.

This function will erase a file.

Since :
3.0