ftw.h(0P)
π¦ ftw.h β file tree traversal π¦
okay so bestie, vibe check first π
this page is ftw.h(0P), and it comes to you straight from the POSIX Programmer's Manual β¨. two things you gotta know before we go any further though, fr fr:
- the Linux implementation of this interface may differ β so if you're on Linux, go consult the corresponding Linux manual page for the actual tea on Linux behavior
- or, honestly? the interface may not be implemented on Linux at all π
iykyk. now let's get into it π«Ά
β¨ SYNOPSIS β¨
#include <ftw.h>
π DESCRIPTION π
first up, the <ftw.h> header shall define the FTW structure, and that struct has to include at least these members, no cap:
int base
int level
next, the <ftw.h> header shall define the following symbolic constants, and they're for use as values of the third argument to the application-supplied function that gets passed as the second argument to ftw() and nftw() π
FTW_Fβ non-directory file πFTW_Dβ directory πΈFTW_DNRβ directory without read permission πFTW_DPβ directory with subdirectories visited πFTW_NSβ unknown type;stat()failed πFTW_SLβ symbolic link π¦FTW_SLNβ symbolic link that names a nonexistent file π
and then the <ftw.h> header shall also define these next symbolic constants, for use as values of the fourth argument to nftw():
FTW_PHYSβ physical walk, does not follow symbolic links. Otherwise,nftw()follows links but does not walk down any path that crosses itself. the way that's giving "look but don't touch" π«ΆFTW_MOUNTβ the walk does not cross a mount point π§ (okay no, not that emoji β π§)FTW_DEPTHβ all subdirectories are visited before the directory itself πFTW_CHDIRβ the walk changes to each directory before reading it π
now the functions. the following shall be declared as functions, and they may also be defined as macros β either way, function prototypes shall be provided:
int ftw(const char *, int (*)(const char *, const struct stat *,
int), int);
int nftw(const char *, int (*)(const char *, const struct stat *,
int, struct FTW *), int, int);
the <ftw.h> header shall define the stat structure and the symbolic names for st_mode and the file type test macros, exactly as described in <sys/stat.h> β
also, just so you're not surprised: inclusion of the <ftw.h> header may also make visible all symbols from <sys/stat.h> π
and finally β the following sections are informative. that's the standard way of saying "these are the vibes, not the requirements" π
π APPLICATION USAGE π
None. literally nothing. a beautiful little void π«Ά
π§ RATIONALE π§
None. empty. iconic, honestly.
β FUTURE DIRECTIONS β
None. the future is wide open, bestie π
π₯ SEE ALSO π₯
<sys_stat.h>- The System Interfaces volume of POSIX.1β2017,
ftw(),nftw()
π COPYRIGHT π
okay this part is the legal bit, so we're being respectful and keeping every word π
Portions of this text are reprinted and reproduced in electronic form from IEEE Std 1003.1-2017, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 7, 2018 Edition, Copyright (C) 2018 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between this version and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html .
Any typographical or formatting errors that appear in this page are most likely to have been introduced during the conversion of the source files to man page format. To report such errors, see https://www.kernel.org/doc/man-pages/reporting_bugs.html .
and that's the whole page, bestie π brought to you by IEEE/The Open Group, dated 2017, filed under ftw.h(0P). go traverse some file trees, you absolute main character πβ¨
π¦ where this page comes from
- alpine 3.22: man-pages-posix 2017a-r0 Β· custom
- alpine 3.23: man-pages-posix 2017a-r0 Β· custom
- alpine 3.24: man-pages-posix 2017a-r0 Β· custom
- arch rolling: man-pages 6.19-1
- arch rolling: man-pages 6.20-1 Β· BSD-2-Clause AND BSD-3-Clause AND BSD-4.3TAHOE AND BSD-4-Clause-UC AND GPL-1.0-or-later AND GPL-2.0-only AND GPL-2.0-or-later AND GPL-3.0-or-later AND LGPL-3.0-linking-exception AND LGPL-3.0-or-later AND LicenseRef-Public-Domain AND LicenseRef-UltraPermissive AND Linux-man-pages-1-para AND Linux-man-pages-copyleft AND Linux-man-pages-copyleft-2-para AND Linux-man-pages-copyleft-var AND MIT AND Spencer-94
- nixpkgs unstable: man-pages-posix 2017a
- opensuse-leap 16.0: man-pages-posix 2017a-160000.4.1 Β· SUSE-IEEE
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms