Eio file management API.

- Main Page
- Related Pages
- Modules
- Data Structures
- Files
- Examples

Functions
Eio file management API.
Eio

A set of function to manage file asynchronously. More...

## Functions
EIO_API 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.
EIO_API 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.
EIO_API 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.
EIO_API 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.
EIO_API 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.
EIO_API 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.
EIO_API 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.
EIO_API 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.
EIO_API 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.

## Detailed Description

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, ...

## Function Documentation

## ◆ eio_file_chmod()

EIO_API 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

  path | The directory path to change access rights.
  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.

References EINA_SAFETY_ON_NULL_RETURN_VAL, and eina_stringshare_add().

## ◆ eio_file_chown()

EIO_API 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.

Note
  Some platforms (including Windows) do not support chown(). In that case, this function returns `NULL`.

References EINA_SAFETY_ON_NULL_RETURN_VAL, and eina_stringshare_add().

## ◆ eio_file_unlink()

EIO_API 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.

References EINA_SAFETY_ON_NULL_RETURN_VAL, and eina_stringshare_add().

## ◆ eio_file_mkdir()

EIO_API 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.

References EINA_SAFETY_ON_NULL_RETURN_VAL, and eina_stringshare_add().

## ◆ eio_file_move()

EIO_API 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

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.

References EINA_SAFETY_ON_NULL_RETURN_VAL, eina_stringshare_add(), and EIO_FILE_MOVE.

## ◆ eio_file_copy()

EIO_API 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

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.

References EINA_SAFETY_ON_NULL_RETURN_VAL, eina_stringshare_add(), and EIO_FILE_COPY.

## ◆ eio_dir_move()

EIO_API 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

  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

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.

References EINA_SAFETY_ON_NULL_RETURN_VAL, eina_stringshare_add(), and EIO_DIR_MOVE.

## ◆ eio_dir_copy()

EIO_API 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

  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

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.

References EINA_SAFETY_ON_NULL_RETURN_VAL, eina_stringshare_add(), and EIO_DIR_COPY.

## ◆ eio_dir_unlink()

EIO_API 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

  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

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.

References EINA_SAFETY_ON_NULL_RETURN_VAL, eina_stringshare_add(), and EIO_UNLINK.