#include <fts.h>

fts.h

includes: sys/_types.h, sys/_types/_dev_t.h, sys/_types/_ino_t.h, sys/_types/_nlink_t.h, _bounds.h, Availability.h, sys/cdefs.h, Availability.h
40 macros · 6 functions · 2 structs · 2 typedefs

structFTS

size 72, align 8
struct _ftsent *fts_curcurrent node
struct _ftsent *fts_childlinked list of children
struct _ftsent **fts_arraysort array
dev_tfts_devstarting device #
char *fts_pathpath for this descent
intfts_rfdfd for root
intfts_pathlensizeof(path)
intfts_nitemselements in the sort array
intfts_optionsfts_open options, global flags

typedefFTS

typedef struct FTS FTS;

macroFTS_COMFOLLOW

#define FTS_COMFOLLOW 0x001
follow command line symlinks

macroFTS_LOGICAL

#define FTS_LOGICAL 0x002
logical walk

macroFTS_NOCHDIR

#define FTS_NOCHDIR 0x004
don't change directories

macroFTS_NOSTAT

#define FTS_NOSTAT 0x008
don't get stat info

macroFTS_PHYSICAL

#define FTS_PHYSICAL 0x010
physical walk

macroFTS_SEEDOT

#define FTS_SEEDOT 0x020
return dot and dot-dot

macroFTS_XDEV

#define FTS_XDEV 0x040
don't cross devices

macroFTS_WHITEOUT

#define FTS_WHITEOUT 0x080
(no longer supported) return whiteout information

macroFTS_COMFOLLOWDIR

#define FTS_COMFOLLOWDIR 0x400
(non-std) follow command line symlinks for directories only

macroFTS_NOSTAT_TYPE

#define FTS_NOSTAT_TYPE 0x800
(non-std) no stat, but use d_type in struct dirent when available

macroFTS_OPTIONMASK

#define FTS_OPTIONMASK 0xcff
valid user option mask

macroFTS_NAMEONLY

#define FTS_NAMEONLY 0x100
(private) child names only

macroFTS_STOP

#define FTS_STOP 0x200
(private) unrecoverable error

macroFTS_THREAD_FCHDIR

#define FTS_THREAD_FCHDIR 0x400
(private) use pthread_fchdir_np

macroFTS_BLOCK_COMPAR

#define FTS_BLOCK_COMPAR 0x80000000
fts_compar is a block

struct_ftsent

size 112, align 8
struct _ftsent *fts_cyclecycle node
struct _ftsent *fts_parentparent directory
struct _ftsent *fts_linknext file in directory
longfts_numberlocal numeric value
void *fts_pointerlocal address value
char *fts_accpathaccess path
char *fts_pathroot path
intfts_errnoerrno for this node
intfts_symfdfd for symlink or chdir
unsigned shortfts_pathlenstrlen(fts_path)
unsigned shortfts_namelenstrlen(fts_name)
ino_tfts_inoinode
dev_tfts_devdevice
nlink_tfts_nlinklink count
shortfts_leveldepth (-1 to N)
unsigned shortfts_infouser flags for FTSENT structure
unsigned shortfts_flagsprivate flags for FTSENT structure
unsigned shortfts_instrfts_set() instructions
struct stat *fts_statpstat(2) information
char[1]fts_namefile name, unsafe with -fbounds-safety

typedefFTSENT

typedef struct _ftsent FTSENT;

macroFTS_ROOTPARENTLEVEL

#define FTS_ROOTPARENTLEVEL -1

macroFTS_ROOTLEVEL

#define FTS_ROOTLEVEL 0

macroFTS_MAXLEVEL

#define FTS_MAXLEVEL 0x7fffffff

macroFTS_D

#define FTS_D 1
preorder directory

macroFTS_DC

#define FTS_DC 2
directory that causes cycles

macroFTS_DEFAULT

#define FTS_DEFAULT 3
none of the above

macroFTS_DNR

#define FTS_DNR 4
unreadable directory

macroFTS_DOT

#define FTS_DOT 5
dot or dot-dot

macroFTS_DP

#define FTS_DP 6
postorder directory

macroFTS_ERR

#define FTS_ERR 7
error; errno is set

macroFTS_F

#define FTS_F 8
regular file

macroFTS_INIT

#define FTS_INIT 9
initialized only

macroFTS_NS

#define FTS_NS 10
stat(2) failed

macroFTS_NSOK

#define FTS_NSOK 11
no stat(2) requested

macroFTS_SL

#define FTS_SL 12
symbolic link

macroFTS_SLNONE

#define FTS_SLNONE 13
symbolic link without target

macroFTS_W

#define FTS_W 14
whiteout object

macroFTS_DONTCHDIR

#define FTS_DONTCHDIR 0x01
don't chdir .. to the parent

macroFTS_SYMFOLLOW

#define FTS_SYMFOLLOW 0x02
followed a symlink to get here

macroFTS_ISW

#define FTS_ISW 0x04
this is a whiteout object

macroFTS_CHDIRFD

#define FTS_CHDIRFD 0x08
indicates the fts_symfd field was set for chdir

macroFTS_AGAIN

#define FTS_AGAIN 1
read node again

macroFTS_FOLLOW

#define FTS_FOLLOW 2
follow symbolic link

macroFTS_NOINSTR

#define FTS_NOINSTR 3
no instructions

macroFTS_SKIP

#define FTS_SKIP 4
discard node

functionfts_children

__DARWIN_INODE64(fts_children)
FTSENT *fts_children(FTS *, int)

functionfts_close

__DARWIN_INODE64(fts_close)
int fts_close(FTS *)

functionfts_open

__DARWIN_INODE64(fts_open)
FTS *fts_open(char *_LIBC_CSTR const *, int, int (*)(const FTSENT **, const FTSENT **))

functionfts_open_b

__DARWIN_INODE64(fts_open_b) __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_2)
FTS *fts_open_b(
	char *_LIBC_CSTR const *,
	int,
	int (^)(const FTSENT **, const FTSENT **) __fts_noescape
)

functionfts_read

__DARWIN_INODE64(fts_read)
FTSENT *fts_read(FTS *)

functionfts_set

__DARWIN_INODE64(fts_set)
int fts_set(FTS *, FTSENT *, int)