single |
The musl-fts package implements the fts(3) functions fts_open, fts_read,
fts_children, fts_set and fts_close, which are missing in musl libc. It
uses the NetBSD implementation of fts(3) to build a static library
/usr/lib/libfts.a and the /usr/include/fts.h header file.
Man page description:
The fts functions are provided for traversing UNIX file hierarchies. A
simple overview is that the fts_open() function returns a "handle" on a
file hierarchy, which is then supplied to the other fts functions. The
function fts_read() returns a pointer to a structure describing one of
the files in the file hierarchy. The function fts_children() returns a
pointer to a linked list of structures, each of which describes one of
the files contained in a directory in the hierarchy. In general,
directories are visited two distinguishable times; in pre-order (before
any of their descendants are visited) and in post-order (after all of
their descendants have been visited). Files are visited once. It is
possible to walk the hierarchy "logically" (ignoring symbolic links) or
physically (visiting symbolic links), order the walk of the hierarchy or
prune and/or re-visit portions of the hierarchy.
|