1ftw.h(0P) POSIX Programmer's Manual ftw.h(0P)
2
3
4
6 This manual page is part of the POSIX Programmer's Manual. The Linux
7 implementation of this interface may differ (consult the corresponding
8 Linux manual page for details of Linux behavior), or the interface may
9 not be implemented on Linux.
10
11
13 ftw.h — file tree traversal
14
16 #include <ftw.h>
17
19 The <ftw.h> header shall define the FTW structure, which shall include
20 at least the following members:
21
22 int base
23 int level
24
25 The <ftw.h> header shall define the following symbolic constants for
26 use as values of the third argument to the application-supplied func‐
27 tion that is passed as the second argument to ftw() and nftw():
28
29 FTW_F Non-directory file.
30
31 FTW_D Directory.
32
33 FTW_DNR Directory without read permission.
34
35 FTW_DP Directory with subdirectories visited.
36
37 FTW_NS Unknown type; stat() failed.
38
39 FTW_SL Symbolic link.
40
41 FTW_SLN Symbolic link that names a nonexistent file.
42
43 The <ftw.h> header shall define the following symbolic constants for
44 use as values of the fourth argument to nftw():
45
46 FTW_PHYS Physical walk, does not follow symbolic links. Otherwise,
47 nftw() follows links but does not walk down any path that
48 crosses itself.
49
50 FTW_MOUNT The walk does not cross a mount point.
51
52 FTW_DEPTH All subdirectories are visited before the directory
53 itself.
54
55 FTW_CHDIR The walk changes to each directory before reading it.
56
57 The following shall be declared as functions and may also be defined as
58 macros. Function prototypes shall be provided.
59
60 int ftw(const char *, int (*)(const char *, const struct stat *,
61 int), int);
62 int nftw(const char *, int (*)(const char *, const struct stat *,
63 int, struct FTW *), int, int);
64
65 The <ftw.h> header shall define the stat structure and the symbolic
66 names for st_mode and the file type test macros as described in
67 <sys/stat.h>.
68
69 Inclusion of the <ftw.h> header may also make visible all symbols from
70 <sys/stat.h>.
71
72 The following sections are informative.
73
75 None.
76
78 None.
79
81 None.
82
84 <sys_stat.h>
85
86 The System Interfaces volume of POSIX.1‐2008, ftw(), nftw()
87
89 Portions of this text are reprinted and reproduced in electronic form
90 from IEEE Std 1003.1, 2013 Edition, Standard for Information Technology
91 -- Portable Operating System Interface (POSIX), The Open Group Base
92 Specifications Issue 7, Copyright (C) 2013 by the Institute of Electri‐
93 cal and Electronics Engineers, Inc and The Open Group. (This is
94 POSIX.1-2008 with the 2013 Technical Corrigendum 1 applied.) In the
95 event of any discrepancy between this version and the original IEEE and
96 The Open Group Standard, the original IEEE and The Open Group Standard
97 is the referee document. The original Standard can be obtained online
98 at http://www.unix.org/online.html .
99
100 Any typographical or formatting errors that appear in this page are
101 most likely to have been introduced during the conversion of the source
102 files to man page format. To report such errors, see https://www.ker‐
103 nel.org/doc/man-pages/reporting_bugs.html .
104
105
106
107IEEE/The Open Group 2013 ftw.h(0P)