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

OSS Library Calls (e - f) ftw64(3)
FTW_F Regular le
FTW_NS A le for which the stat64() function could not be executed successfully
FTW_SL Symbolic link
If ag is FTW_DNR, the les and subdirectories contained in that directory are not processed.
If ag is FTW_NS, the stat64 structure contents are meaningless. An example of a le that
causes FTW_NS to be passed to the function parameter is a le in a directory for which you have
read permission but not execute (search) permission. This condition also returns the value
[EACCES] in errno.
The ftw64( ) function nishes processing a directory before processing any of its les or sub-
directories.
The ftw64( ) function continues the search until either the directory hierarchy specied by the
path parameter is completely searched, an invocation of the function specied by the function
parameter returns a nonzero value, or an error is detected within ftw64(), such as an I/O error.
Because ftw64() is recursive, it can terminate with a memory fault because of stack overow
when the function is called for very deep tree structures.
The ftw64( ) function uses the malloc() function to allocate dynamic storage during its opera-
tion. If ftw64( ) is terminated prior to its completion, such as when the longjmp( ) function is exe-
cuted by the function specied by the function parameter, ftw64() cannot free that storage. The
storage remains allocated.
The ftw64( ) function traverses symbolic links encountered in the resolution of path, including
the nal component. Symbolic links encountered while traversing the directory tree rooted at
path are not traversed.
Use on Guardian Objects
All Guardian les (that is, les in /G) that are visible to the opendir() function can be traversed.
This includes temporary and structured les.
Safeguard subsystem security controls on Guardian objects do not affect the outcome of a call to
the ftw64() function.
Use From the Guardian Environment
The ftw64( ) function is one of a set of functions that have the following effects when the rst of
them is called from the Guardian environment:
Two Guardian le system le numbers (not necessarily the next two available) are allo-
cated for the root directory and the current working directory. These le 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 rst of the set of functions is called. The effects are not cumu-
lative.
NOTES
The ftw64( ) 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 les under / often are not appropriate for local
Guardian les or for any les on other HP NonStop server nodes.
527187-007 Hewlett-Packard Company 2149