Open System Services Library Calls Reference Manual (G06.29+, H06.08+, J06.03+)
nftw64(3) OSS Library Calls Reference Manual
DESCRIPTION
The nftw64( ) function is similar to the nftw( ) function except that, in addition to supporting
smaller files, the nftw64( ) function supports OSS files larger than approximately 2 gigabytes.
nftw64( ) calls from a 64-bit application are redirected to the nftw( ) function. A 32-bit applica- |
tion can explicitly call this function when you compile the application using the #define |
_LARGEFILE64_SOURCE 1 feature test macro or an equivalent compiler command option.
An application call to nftw( ) from a 32-bit application is automatically mapped to this function |
when you compile the application using the #define _FILE_OFFSET_BITS 64 feature test |
macro or an equivalent compiler command option.
The nftw64( ) function recursively searches the directory hierarchy that descends from the direc-
tory specified by the path parameter. For each file in the hierarchy, nftw64( ) calls the function
pointed to by the function parameter and passes four arguments.
The flag value passed to the function parameter identifies the file type of the object specified for
the object parameter or provides other information that modifies the operation of the nftw64( )
function. The flag value can be one of the following:
FTW_D Specifies that the object is a directory.
FTW_DNR Specifies that the object is a directory that cannot be read.
FTW_DP Specifies that the object is a directory and that subdirectories have already been
traversed. This value is used only when the flags parameter includes the
FTW_DEPTH flag.
FTW_F Specifies that the object is a regular file.
FTW_NS Specifies that the object is a file for which the stat64( ) function could not be
executed successfully.
FTW_SL Specifies that the object is a symbolic link. This value is used only when the
flags parameter includes the FTW_PHYS flag.
FTW_SLN Specifies that the object is a symbolic link that does not name an existing file.
This value is used only when the flags parameter does not include the
FTW_PHYS flag.
If flag is FTW_DNR, the files and subdirectories contained in that directory are not processed.
If flag is FTW_NS, the stat64 structure contents are meaningless. An example of a file that
causes FTW_NS to be passed to the function parameter is a file in a directory for which you have
read permission but not execute (search) permission. This condition also returns the value
[EACCES] in errno.
The nftw64( )
function finishes processing a directory before processing any of its files or sub-
dir
e
ctories.
The nftw64( ) function continues the search until either the directory hierarchy specified by the
path parameter is completely searched, an invocation of the function specified by the function
parameter returns a nonzero value, or an error is detected within nftw64( ), such as an I/O error.
Because nftw64( ) is recursive, it can terminate with a memory fault because of stack overflow
when the function is called for very deep tree structures.
The nftw64( ) function uses the malloc( ) function to allocate dynamic storage during its opera-
tion. If nftw64( ) is terminated prior to its completion, such as when the longjmp( ) function is
executed by the function specified by the function parameter, nftw64( ) cannot free that storage.
The storage remains allocated.
5−26 Hewlett-Packard Company 527187-017