Open System Services Library Calls Reference Manual (G06.28+, H06.05+)

nftw(3) OSS Library Calls Reference Manual
NAME
nftw - Traverses a le tree
LIBRARY
G-series native OSS processes: /G/system/sysnn/zossesrl
H-series OSS processes: /G/system/zdllnnn/zossedll
SYNOPSIS
#include <ftw.h>
int nftw(
const char *path,
int(*function)
(const char *object,
const struct stat *ptr,
int flag,
struct FTW *sftw),
int depth,
int flags);
PARAMETERS
path Points to the directory hierarchy to be searched.
function Points to the function to be invoked for each le in the directory hierarchy.
object Points to the name of the next le in the directory hierarchy specied in the path
parameter. This name must be a null-terminated string.
ptr Points to a stat structure, as dened in the sys/stat.h header le. The stat struc-
ture contains information about the le specied in the object parameter.
flag Species the type of le. See DESCRIPTION.
depth Indicates the maximum number of directory streams, le descriptors, or both
available for use by the nftw() function while traversing the tree. This parame-
ter is ignored in the OSS implementation.
flags Species optional ags that modify the operation of the nftw() function. The
following ags can be logically ORed to create the value for this parameter:
FTW_CHDIR Changes to each directory before reading its contents.
FTW_DEPTH Traverses all subdirectories before the directory itself.
FTW_MOUNT
Does not cross mount points during traversal.
FTW_PHYS Physically traverses the le tree, but does not follow symbolic
links. If this ag is not specied, nftw() does follow symbolic
links but does not go down any path that crosses itself.
sftw Points to an FTW structure. This structure contains the following elds of type
int:
base Contains the offset of the object lename in the pathname
passed in the path parameter.
level Contains the depth relative to the root of the search. The level
of the root of the search is 0 (zero).
54 Hewlett-Packard Company 527187-007