Data Structures | |
struct | fsdev_t |
Filesystem device structure. More... | |
Defines | |
#define | MTAB_PATH "/etc/mtab" |
#define | LOCAL_FILESYSTEMS |
Functions | |
fsdev_t * | fsdev_init (const char **fs, size_t fs_cnt) |
Initialize the fsdev_t structure from an array of filesystem names. | |
fsdev_t * | fsdev_strinit (const char *fs_names) |
Initialize the fsdev_t structure from a string containing filesystem names. | |
void | fsdev_free (fsdev_t *lfs) |
Free the fsdev_t structure. | |
int | fsdev_search (fsdev_t *lfs, void *id) |
Search an id in the fsdev_t structure. | |
int | fsdev_path (fsdev_t *lfs, const char *path) |
Check whether a path points points to a place on any of the devices in the fsdev_t structure. | |
int | fsdev_fd (fsdev_t *lfs, int fd) |
Check whether a file descriptor is associated with a file that resides on any of the devices in the fsdev_t structure. | |
int | find_files (SEXP_t *spath, SEXP_t *sfilename, SEXP_t *behaviors, int(*cb)(const char *, const char *, void *), void *arg) |
Search the filesystem according to the specified path, filename and behaviors. | |
Variables | |
uint16_t | fsdev_t::cnt |
Number of items in the array. |
#define LOCAL_FILESYSTEMS |
{ "btrfs", \ "ext2", "ext3", "ext4", \ "ffs", \ "gfs", \ "hpfs", \ "jfs", \ "reiser4", "reiserfs", \ "ufs", \ "xfs", \ "zfs", NULL}
int find_files | ( | SEXP_t * | spath, | |
SEXP_t * | sfilename, | |||
SEXP_t * | behaviors, | |||
int(*)(const char *, const char *, void *) | cb, | |||
void * | arg | |||
) |
Search the filesystem according to the specified path, filename and behaviors.
For all paths and files that satisfy these requirements call the provided callback function.
path | the requested path in a sexp form, which may specify the matching operation or a var_ref | |
filenam | the requested filename in a sexp form, which may specify the matching operation or a var_ref | |
behaviors | the behaviors may specify the recursion depth or direction | |
cb | for each match, the callback function cb is called with first argument being the matched path and the second being the matched filename | |
arg | an optional argument to the callback function |
int fsdev_fd | ( | fsdev_t * | lfs, | |
int | fd | |||
) |