Open System Services Library Calls Reference Manual (G06.29+, H06.08+, J06.03+)

OSS Library Calls (e - f) ftw(3)
in errno.
The ftw( ) function finishes processing a directory before processing any of its files or subdirec-
tories.
The ftw( ) 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 parame-
ter returns a nonzero value, or an error is detected within ftw( ), such as an I/O error.
Because ftw( ) is recursive, it can terminate with a memory fault because of stack overflow when
the function is called for very deep tree structures.
The ftw( ) function uses the malloc( ) function to allocate dynamic storage during its operation. If
ftw( ) is terminated prior to its completion, such as when the longjmp( ) function is executed by
the function specified by the function parameter, ftw( ) cannot free that storage. The storage
remains allocated.
The ftw( ) function traverses symbolic links encountered in the resolution of path, including the
final component. Symbolic links encountered while traversing the directory tree rooted at path
are not traversed.
When called from 64-bit OSS processes, the ftw( ) function supports files larger than approxi- |
mately 2 gigabytes.
Use on Guardian Objects
All Guardian files (that is, files in /G) that are visible to the opendir( ) function can be traversed.
This includes temporary and structured files.
Safeguard subsystem security controls on Guardian objects do not affect the outcome of a call to
the ftw( ) function.
Use From the Guardian Environment
The ftw( ) function is one of a set of functions that have the following effects when the first of
them is called from the Guardian environment:
Two Guardian file system file numbers (not necessarily the next two available) are allo-
cated for the root directory and the current working directory. These file numbers cannot
be closed by calling the Guardian FILE_CLOSE_ procedure.
The current working directory is assigned from the VOLUME attribute of the Guardian
environment =_DEFAULTS DEFINE.
The use of static memory by the process increases slightly.
These effects occur only when the first of the set of functions is called. The effects are not cumu-
lative.
NOTES
The ftw( ) function is reentrant. Ensure that the function supplied as the function parameter is
also reentrant.
If you use this function on the local / (slash) root directory, the action includes the /G and /E
directories. Actions appropriate for local OSS files under / often are not appropriate for local
Guardian files or for any files on other HP NonStop server nodes.
You can use the UTILSGE environment variable that governs shell utility to test or recommend
whether use should include Guardian files or files on remote HP NonStop server nodes.
UTILSGE settings are only advisory for functions; changing the variable value does not affect
function behavior. For more information about UTILSGE, see the environ(5) reference page.
527187-017 Hewlett-Packard Company 2201