Info Node: (libext2fs.info)Iterating over a directory
(libext2fs.info)Iterating over a directory
Iterating over a directory
--------------------------
- Function: errcode_t ext2fs_dir_iterate (ext2_filsys FS, ext2_ino_t
DIR, int FLAGS, char *BLOCK_BUF, int (*FUNC)(struct
ext2_dir_entry *DIRENT, int OFFSET, int BLOCKSIZE, char *BUF,
void *PRIVATE), void *PRIVATE)
This function interates over all of the directory entries in the
directory DIR, calling the callback function FUNC for each
directory entry in the directory. The BLOCK_BUF parameter should
either be NULL, or if the `ext2fs_dir_iterate' function is called
repeatedly, the overhead of allocating and freeing scratch memory
can be avoided by passing a pointer to a scratch buffer which must
be at least as big as the filesystem's blocksize.
The FLAGS parameter controls how the iterator will function:
`DIRENT_FLAG_INCLUDE_EMPTY'
This flag indicates that the callback function should be
called even for deleted or empty directory entries.