ftw(5) ftw(5)
NAME
ftw - file tree traversal
SYNOPSIS
#include <ftw.h>
DESCRIPTION
The <ftw.h> header defines the FTW structure that includes at least
the following members:
int base
int level
The <ftw.h> header defines macros for use as values of the third argu-
ment to the application-supplied function that is passed as the second
argument to ftw() and nftw():
FTWF File.
FTWD Directory.
FTWDNR Directory without read permission.
FTWNS Unknown type, stat() failed.
FTWSL Symbolic link.
FTWSLN Symbolic link that names a non-existent file.
The <ftw.h> header defines macros for use as values of the fourth
argument to nftw():
FTWPHYS Physical walk, does not follow symbolic links. Other-
wise, nftw() will follow links but will not walk down
any path that crosses itself.
FTWMOUNT The walk will not cross a mount point.
FTWCHDIR The walk will change to each directory before reading
it.
FTWDEPTH All subdirectories will be visited before the direc-
tory itself.
FTWNONFS No NFS filesystems are traversed.
Page 1 Reliant UNIX 5.44 Printed 11/98
ftw(5) ftw(5)
The following are declared as functions and may also be defined as
macros:
int ftw(const char *path,
int (*fn)(const char *, const struct stat *, int), int ndirs);
int nftw(const char *path, int (*fn)
(const char *, const struct stat *, int, struct FTW*),
int depth, int flags);
The <ftw.h> header defines the stat structure and the symbolic names
for stmode and the file type test macros as described in
<sys/stat.h>.
Inclusion of the <ftw.h> header may also make visible all symbols from
<sys/stat.h>.
The following are declared as functions and may also be defined as
macros:
int ftw64(const char *path,
int (*fn)(const char *, const struct stat64 *, int),
int ndirs);
int nftw64(const char *path,
int (*fn)(const char *, const struct stat64 *, int,
struct FTW *),
int depth, int flags);
SEE ALSO
ftw(3C), nftw(3C), lfs(5), stat(5).
Page 2 Reliant UNIX 5.44 Printed 11/98