![Symbian Developer Library](../../../../a_stock/images/mainheading.gif)
![]() |
![]() |
|
Interface status: | externallyDefinedApi |
FTW_F 0
Regular File. Valid flags for the 3rd argument to the function that is passed as the second argument to ftw(3) and nftw(3).
Interface status: | externallyDefinedApi |
FTW_D 1
Valid flags for the 3rd argument to the function that is passed as the second argument to ftw(3) and nftw(3). Directory.
Interface status: | externallyDefinedApi |
FTW_DNR 2
Valid flags for the 3rd argument to the function that is passed as the second argument to ftw(3) and nftw(3). Directory without read permission.
Interface status: | externallyDefinedApi |
FTW_DP 3
Valid flags for the 3rd argument to the function that is passed as the second argument to ftw(3) and nftw(3). Directory with subdirectories visited. A file on which stat could not successfully be executed.
Interface status: | externallyDefinedApi |
FTW_NS 4
Valid flags for the 3rd argument to the function that is passed as the second argument to ftw(3) and nftw(3). A file on which stat could not successfully be executed.
Interface status: | externallyDefinedApi |
FTW_SL 5
Valid flags for the 3rd argument to the function that is passed as the second argument to ftw(3) and nftw(3). Symbolic link.
Interface status: | externallyDefinedApi |
FTW_SLN 6
Valid flags for the 3rd argument to the function that is passed as the second argument to ftw(3) and nftw(3). Sym link that names a nonexistent file.
FTW_PHYS 0x01
Flags for use as the 4th argument to nftw(3). These may be ORed together. Physical walk, don't follow sym links.
FTW_MOUNT 0x02
Flags for use as the 4th argument to nftw(3). These may be ORed together. The walk does not cross a mount point.
FTW_DEPTH 0x04
Flags for use as the 4th argument to nftw(3). These may be ORed together. Subdirs visited before the dir itself.
FTW_CHDIR 0x08
Flags for use as the 4th argument to nftw(3). These may be ORed together. Change to a directory before reading it.
Interface status: | externallyDefinedApi |
IMPORT_C int ftw(const char *, int(*)(const char *, const struct stat *, int), int);
The ftw(const char *,int(*)(const char *, const struct stat *, int),int)
ftw(const char *,int(*)(const char *, const struct stat *, int),int)
function shall recursively descend the directory hierarchy rooted in path. For each object in the hierarchy, ftw(const char *,int(*)(const char *, const struct stat *, int),int)
ftw(const char *,int(*)(const char *, const struct stat *, int),int)
shall call the function pointed to by fn, passing it a pointer to a null-terminated character string containing the name
of the object, a pointer to a stat structure containing information about the object, and an integer.Possible values of the
integer are: FTW_D For a directory. FTW_DNR For a directory that cannot be read. FTW_F For a file. FTW_SL For a symbolic link
(but see also FTW_NS below). FTW_NS For an object other than a symbolic link on which stat(const char *,struct stat *)
stat(const char *,struct stat *)
could not successfully be executed. If the object is a symbolic link and stat(const char *,struct stat *)
stat(const char *,struct stat *)
failed, it is unspecified whether ftw(const char *,int(*)(const char *, const struct stat *, int),int)
ftw(const char *,int(*)(const char *, const struct stat *, int),int)
passes FTW_SL or FTW_NS to the user-supplied function.
The argument nfds should be in the range [1, {OPEN_MAX}].
Errors: [EACCES] Search permission is denied for any component of path or read permission is denied for path. [ELOOP] A loop exists in symbolic links encountered during resolution of the path argument. [ENAMETOOLONG] The length of the path argument exceeds {PATH_MAX} or a pathname component is longer than {NAME_MAX}. [ENOENT] A component of path does not name an existing file or path is an empty string. [ENOTDIR] A component of path is not a directory. [EOVERFLOW] A field in the stat structure cannot be represented correctly in the current programming environment for one or more files found in the file hierarchy.
Examples:
/* Detailed description: Sample usage of ftw system call
Preconditions: Function fn with the specified prototype should be defined and
should have atleast two objects in the current working directory.
*/
# 54 "d:/EPOC/release/9.4/common/generic/openenv/core/include/ftw.dosc" 2
# 55 "d:/EPOC/release/9.4/common/generic/openenv/core/include/ftw.dosc" 2
# 56 "d:/EPOC/release/9.4/common/generic/openenv/core/include/ftw.dosc" 2
if (ftw(".", fn, 2) != 0) {
perror("ftw"); exit(2);
}
else
{
printf("ftw call succeded");
}
Output
ftw call succeded
|
|
stat(const char *,struct stat *)
stat(const char *,struct stat *)
Gets the size of a file.