Open System Services Library Calls Reference Manual (G06.29+, H06.08+, J06.03+)
ftw64(3) OSS Library Calls Reference Manual
NAME
ftw64 - Traverses a file tree
LIBRARY
G-series native OSS processes: /G/system/sysnn/zossesrl
32-bit H-series and J-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 flag),
int ndirs);
PARAMETERS
path Points to the directory hierarchy to be searched.
function Points to the function to be invoked for each file in the directory hierarchy.
object Points to the name of the next file in the directory hierarchy specified in the path
parameter. This name must be a null-terminated string.
ptr Points to a stat64 structure, as defined in the sys/stat.h header file. The stat64
structure contains information about the file specified in the object parameter.
flag Specifies the type of file. See DESCRIPTION.
ndirs Indicates the maximum number of directory streams, file 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 files, the ftw64( ) function supports OSS files larger than approximately 2 gigabytes.
ftw64( ) function calls from a 64-bit application are redirected to the ftw( ) function. A 32-bit |
application can explicitly call this function when the application is compiled using the #define |
_LARGEFILE64_SOURCE 1 feature test macro or an equivalent compiler command option.
An application call to ftw( ) from a 32-bit application is automatically mapped to this function |
when the application is compiled using the #define _FILE_OFFSET_BITS 64 feature test |
macro or an equivalent compiler command option.
The ftw64( ) function recursively searches the directory hierarchy that descends from the direc-
tory specified by the path parameter.
For each file 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 file, a pointer
to a stat64 structure containing information about the file, and an integer flag value.
The flag value passed to the function parameter identifies the file type. The flag value can be one
of the following:
FTW_D Directory
FTW_DNR Directory that cannot be read
2−204 Hewlett-Packard Company 527187-017