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

ftw64(3) OSS Library Calls Reference Manual
NAME
ftw64 - Traverses a le tree
LIBRARY
G-series native OSS processes: /G/system/sysnn/zossesrl
H-series OSS processes: /G/system/zdllnnn/zossedll
SYNOPSIS
#include <ftw64.h>
int ftw64(
const char *path,
int(*function)(const char *object,
const struct stat64 *ptr,
int ag),
int ndirs);
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 stat64 structure, as dened in the sys/stat.h header le. The stat64
structure contains information about the le specied in the object parameter.
flag Species the type of le. See DESCRIPTION.
ndirs Indicates the maximum number of directory streams, le descriptors, or both
available for use by the ftw64() function while traversing the tree. This parame-
ter is ignored in the OSS implementation.
DESCRIPTION
The ftw64( ) function is similar to the ftw( ) function except that, in addition to supporting
smaller les, the ftw64() function supports OSS les larger than approximately 2 gigabytes.
An application can explicitly call this function when the application is compiled using the
#dene _LARGEFILE64_SOURCE 1 feature test macro or an equivalent compiler command
option.
An application call to ftw() is automatically mapped to this function when the applciation is
compiled using the #dene _FILE_OFFSET_BITS 64 feature test macro or an equivalent com-
piler command option.
The ftw64( ) function recursively searches the directory hierarchy that descends from the direc-
tory specied by the path parameter.
For each le in the hierarchy, ftw64( ) calls the function pointed to by the function parameter,
passes it a pointer to a null-terminated character string containing the name of the le, a pointer
to a stat64 structure containing information about the le, and an integer ag value.
The ag value passed to the function parameter identies the le type. The ag value can be one
of the following:
FTW_D Directory
FTW_DNR Directory that cannot be read
2148 Hewlett-Packard Company 527187-007