Update contrib.
1 /** @file ../include/ftw.h
5 /** @fn ftw(const char *path, int (*fn)(const char *, const struct stat *, int), int nfds)
9 @return If the tree is exhausted, ftw() shall return 0.
10 If the function pointed to by fn returns a non-zero value, ftw() shall stop its tree traversal and
11 return whatever value was returned by the function pointed to by fn.
12 If ftw() detects an error, it shall return -1 and set errno to indicate the error.
14 The ftw() function shall recursively descend the directory hierarchy rooted in path.
15 For each object in the hierarchy, ftw() shall call the function pointed to by fn,
16 passing it a pointer to a null-terminated character string containing the name of the object,
17 a pointer to a stat structure containing information about the object, and an integer.Possible values of the integer are:
21 For a directory that cannot be read.
25 For a symbolic link (but see also FTW_NS below).
27 For an object other than a symbolic link on which stat() could not successfully be executed.
28 If the object is a symbolic link and stat() failed,
29 it is unspecified whether ftw() passes FTW_SL or FTW_NS to the user-supplied function.
31 The argument nfds should be in the range [1, {OPEN_MAX}].
35 Search permission is denied for any component of path or read permission is denied for path.
37 A loop exists in symbolic links encountered during resolution of the path argument.
39 The length of the path argument exceeds {PATH_MAX} or a pathname component is longer than {NAME_MAX}.
41 A component of path does not name an existing file or path is an empty string.
43 A component of path is not a directory.
45 A field in the stat structure cannot be represented correctly in the current programming environment
46 for one or more files found in the file hierarchy.
50 /* Detailed description: Sample usage of ftw system call
51 * Preconditions: Function fn with the specified prototype should be defined and
52 * should have atleast two objects in the current working directory.
58 if (ftw(".", fn, 2) != 0) {
59 perror("ftw"); exit(2);
63 printf("ftw call succeded");
75 @capability Deferred @ref RFs::Entry(const TDesC16&, TEntry&)
81 /** @fn ftw64(const char *path, int (*fn)(const char *, const struct stat64 *, int), int nfds)
85 @return If the tree is exhausted, ftw64() shall return 0.
86 If the function pointed to by fn returns a non-zero value, ftw64() shall stop its tree traversal and
87 return whatever value was returned by the function pointed to by fn.
88 If ftw64() detects an error, it shall return -1 and set errno to indicate the error.
90 For full documentation see: http://www.unix.org/version2/whatsnew/lfs20mar.html#3.0
100 Regular File. Valid flags for the 3rd argument to the function that is passed as the second argument to ftw(3) and nftw(3).
103 @externallyDefinedApi
108 Valid flags for the 3rd argument to the function that is passed as the second argument to ftw(3) and nftw(3).
112 @externallyDefinedApi
117 Valid flags for the 3rd argument to the function that is passed as the second argument to ftw(3) and nftw(3).
118 Directory without read permission.
121 @externallyDefinedApi
126 Valid flags for the 3rd argument to the function that is passed as the second argument to ftw(3) and nftw(3).
127 Directory with subdirectories visited. A file on which stat could not successfully be
132 @externallyDefinedApi
137 Valid flags for the 3rd argument to the function that is passed as the second argument to ftw(3) and nftw(3).
138 A file on which stat could not successfully be executed.
142 @externallyDefinedApi
147 Valid flags for the 3rd argument to the function that is passed as the second argument to ftw(3) and nftw(3).
151 @externallyDefinedApi
156 Valid flags for the 3rd argument to the function that is passed as the second argument to ftw(3) and nftw(3).
157 Sym link that names a nonexistent file.
160 @externallyDefinedApi
165 Flags for use as the 4th argument to nftw(3). These may be ORed together.
166 Physical walk, don't follow sym links.
174 Flags for use as the 4th argument to nftw(3). These may be ORed together.
175 The walk does not cross a mount point.
183 Flags for use as the 4th argument to nftw(3). These may be ORed together.
184 Subdirs visited before the dir itself.
192 Flags for use as the 4th argument to nftw(3). These may be ORed together.
193 Change to a directory before reading it.