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
12 ftw.h — file tree traversal
13
15 #include <ftw.h>
16
18 The <ftw.h> header shall define the FTW structure, which shall include
19 at least the following members:
20
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
61 int ftw(const char *, int (*)(const char *, const struct stat *,
62 int), int);
63 int nftw(const char *, int (*)(const char *, const struct stat *,
64 int, struct FTW *), int, int);
65
66 The <ftw.h> header shall define the stat structure and the symbolic
67 names for st_mode and the file type test macros as described in
68 <sys/stat.h>.
69
70 Inclusion of the <ftw.h> header may also make visible all symbols from
71 <sys/stat.h>.
72
73 The following sections are informative.
74
76 None.
77
79 None.
80
82 None.
83
85 <sys_stat.h>
86
87 The System Interfaces volume of POSIX.1‐2017, ftw(), nftw()
88
90 Portions of this text are reprinted and reproduced in electronic form
91 from IEEE Std 1003.1-2017, Standard for Information Technology -- Por‐
92 table Operating System Interface (POSIX), The Open Group Base Specifi‐
93 cations Issue 7, 2018 Edition, Copyright (C) 2018 by the Institute of
94 Electrical and Electronics Engineers, Inc and The Open Group. 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.opengroup.org/unix/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 2017 ftw.h(0P)