int nftw(const char *path, int (*fn)(const char *, const struct stat *, int, struct FTW *), int depth, int flags);
int nftw64(const char *path, int (*fn)(const char *, const struct stat64 *, int, struct FTW *), int depth, int flags);
nftw()changes the current working directory to each directory as it reports file in that directory. If clear, nftw()does not change the current working directory.
nftw()reports all files in a directory before reporting the directory itself. If clear, nftw()reports any directory before reporting the files in that directory.
nftw()only reports files in the same file system as the specified path. If clear, nftw()reports all files encountered during a walk.
nftw()performs a physical walk and does not follow symbolic links. If clear, nftw()follows links instead of reporting them, and does not report the same file twice.
For each object in the hierarchy,
- A pointer to a null-terminated character string containing the name of the object
- A pointer to a stat structure containing information about the object,
- An integer flag. Possible values for the flag are:
For a file.
For a directory.
For a directory for which the contents have already been visited. This condition only occurs if the FTW_DEPTH flag is specified.
For a symbolic link. This condition only occurs if the FTW_PHYS flag is specified.
For a symbolic link that does not name an existing file. This condition only occurs if the FTW_PHYS flag is not specified.
For a directory that cannot be read. The user function is not called for any of its descendants.
For an object on which
stat()could not be successfully executed. The stat buffer passed to the function is undefined.
- A pointer to an FTW structure. The value of the base member is the offset of the object's file name in the path name passed as the first argument to the function. The value of the level member indicates the depth relative to the root of the walk, where the root level is 0.
The tree traversal continues until the tree is exhausted, the user-supplied
function returns a non-zero value, or some error, other than
EACCES, is detected within
Is the root of the directory hierarchy to be traversed.
Is the function to be called for each element of the tree.
Specifies the maximum number of directory streams or file descriptors (or both) that are available for use by
nftw()while traversing the tree. This should be in the range of [1, OPEN_MAX].
Indicates the flag values, as described in the DESCRIPTION section.
Search permission is denied for any component of path or read permission is denied for path.
The value specified for depth is invalid.
The length of path exceeds PATH_MAX, or a path name component is longer than NAME_MAX, or either condition holds for a path name generated during the tree traversal.
path points to an empty string or to the name of a file that does not exist.
Insufficient memory is available to complete the request.
A component of the path name prefix is not a directory.
UNIX 98, with exceptions
MT-Safe, with exceptions.
This function is MT-Safe unless the FTW_CHDIR flag is specified.
Windows current supports neither symbolic links nor mounted file systems, so the FTW_MOUNT and FTW_PHYS flags have no effect.
PTC MKS Toolkit for Professional Developers
PTC MKS Toolkit for Professional Developers 64-Bit Edition
PTC MKS Toolkit for Enterprise Developers
PTC MKS Toolkit for Enterprise Developers 64-Bit Edition
- l64, struct stat
PTC MKS Toolkit 10.3 Documentation Build 39.