Functions to traverse directories and split paths. More...

Defines

#define EINA_FILE_DIR_LIST_CB(function)   ((Eina_File_Dir_List_Cb)function)
 cast to an Eina_File_Dir_List_Cb.

Typedefs

typedef void(* Eina_File_Dir_List_Cb )(const char *name, const char *path, void *data)
 Type for a callback.

Functions

EAPI Eina_Bool eina_file_dir_list (const char *dir, Eina_Bool recursive, Eina_File_Dir_List_Cb cb, void *data)
 List all files on the directory calling the function for every file found.
EAPI Eina_Bool EAPI Eina_Arrayeina_file_split (char *path) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1)

Detailed Description

Functions to traverse directories and split paths.

  • eina_file_dir_list() list the content of a directory, recusrsively or not, and can call a callback function for eachfound file.
  • eina_file_split() split a path into all the subdirectories that compose it, according to the separator of the file system.

Define Documentation

#define EINA_FILE_DIR_LIST_CB (   function  )     ((Eina_File_Dir_List_Cb)function)

cast to an Eina_File_Dir_List_Cb.

Parameters:
function The function to cast.

This macro casts function to Eina_File_Dir_List_Cb.


Function Documentation

EAPI Eina_Bool eina_file_dir_list ( const char *  dir,
Eina_Bool  recursive,
Eina_File_Dir_List_Cb  cb,
void *  data 
)

List all files on the directory calling the function for every file found.

Parameters:
dir The directory name.
recursive Iterate recursively in the directory.
cb The callback to be called.
data The data to pass to the callback.
Returns:
EINA_TRUE on success, EINA_FALSE otherwise.

This function lists all the files in dir. To list also all the sub directoris recursively, recursive must be set to EINA_TRUE, otherwise it must be set to EINA_FALSE. For each found file, cb is called and data is passed to it.

If cb or dir are NULL, or if dir is a string of size 0, or if dir can not be opened, this function returns EINA_FALSE immediatly. otherwise, it returns EINA_TRUE.