Print this page
1438 ftw(3C) should mention `quit' member of struct FTW and possible values


 232 .ad
 233 .RS 11n
 234 The \fBstat()\fR function failed on the object because of lack of appropriate
 235 permission. The stat buffer passed to \fIfn\fR is undefined.  Failure of
 236 \fBstat()\fR for any other reason is considered an error and \fBnftw()\fR
 237 returns \(mi1.
 238 .RE
 239 
 240 .RE
 241 
 242 .RE
 243 .RS +4
 244 .TP
 245 .ie t \(bu
 246 .el o
 247 The fourth argument is a pointer to an \fBFTW\fR structure that contains the
 248 following members:
 249 .sp
 250 .in +2
 251 .nf

 252 int   base;
 253 int   level;
 254 .fi
 255 .in -2
 256 























 257 The \fBbase\fR member is the offset of the object's filename in the pathname
 258 passed as the first argument to \fIfn\fR(). The value of \fBlevel\fR indicates
 259 the depth relative to the root of the walk, where the root level is 0.
 260 .sp
 261 The results are unspecified if the application-supplied \fIfn\fR() function
 262 does not preserve the current working directory.
 263 .RE
 264 .sp
 265 .LP
 266 Both \fBftw()\fR and \fBnftw()\fR use one file descriptor for each level in the
 267 tree. The \fIdepth\fR argument limits the number of file descriptors used. If
 268 \fIdepth\fR is zero or negative, the effect is the same as if it were 1. It
 269 must not be greater than the number of file descriptors currently available for
 270 use.  The \fBftw()\fR function runs faster if \fIdepth\fR is at least as large
 271 as the number of levels in the tree. Both \fBftw()\fR and \fBnftw()\fR are able
 272 to descend to arbitrary depths in a file hierarchy and do not fail due to path
 273 length limitations unless either the length of the path name pointed to by the
 274 \fIpath\fR argument exceeds {\fBPATH_MAX\fR} requirements, or for \fBftw()\fR,
 275 the specified depth is less than 2, or for \fBnftw()\fR, the specified depth is
 276 less than 2 and \fBFTW_CHDIR\fR is not set. When \fBftw()\fR and \fBnftw()\fR




 232 .ad
 233 .RS 11n
 234 The \fBstat()\fR function failed on the object because of lack of appropriate
 235 permission. The stat buffer passed to \fIfn\fR is undefined.  Failure of
 236 \fBstat()\fR for any other reason is considered an error and \fBnftw()\fR
 237 returns \(mi1.
 238 .RE
 239 
 240 .RE
 241 
 242 .RE
 243 .RS +4
 244 .TP
 245 .ie t \(bu
 246 .el o
 247 The fourth argument is a pointer to an \fBFTW\fR structure that contains the
 248 following members:
 249 .sp
 250 .in +2
 251 .nf
 252 int   quit;
 253 int   base;
 254 int   level;
 255 .fi
 256 .in -2
 257 
 258 The \fBquit\fR member has a default value of \fI0\fR, but can be set to the
 259 following values:
 260 .RS
 261 
 262 .sp
 263 .ne 2
 264 .na
 265 \fB\fBFTW_SKIP\fR\fR or \fB\fBFTW_PRUNE\fR\fR
 266 .ad
 267 .RS 11n
 268 This object and its descendants are pruned from the search.
 269 .RE
 270 
 271 .sp
 272 .ne 2
 273 .na
 274 \fB\fBFTW_FOLLOW\fR\fR
 275 .ad
 276 .RS 11n
 277 If this object is a symbolic link, follow the link to its physical counterpart.
 278 .RE
 279 
 280 .sp
 281 The \fBbase\fR member is the offset of the object's filename in the pathname
 282 passed as the first argument to \fIfn\fR(). The value of \fBlevel\fR indicates
 283 the depth relative to the root of the walk, where the root level is 0.
 284 .sp
 285 The results are unspecified if the application-supplied \fIfn\fR() function
 286 does not preserve the current working directory.
 287 .RE
 288 .sp
 289 .LP
 290 Both \fBftw()\fR and \fBnftw()\fR use one file descriptor for each level in the
 291 tree. The \fIdepth\fR argument limits the number of file descriptors used. If
 292 \fIdepth\fR is zero or negative, the effect is the same as if it were 1. It
 293 must not be greater than the number of file descriptors currently available for
 294 use.  The \fBftw()\fR function runs faster if \fIdepth\fR is at least as large
 295 as the number of levels in the tree. Both \fBftw()\fR and \fBnftw()\fR are able
 296 to descend to arbitrary depths in a file hierarchy and do not fail due to path
 297 length limitations unless either the length of the path name pointed to by the
 298 \fIpath\fR argument exceeds {\fBPATH_MAX\fR} requirements, or for \fBftw()\fR,
 299 the specified depth is less than 2, or for \fBnftw()\fR, the specified depth is
 300 less than 2 and \fBFTW_CHDIR\fR is not set. When \fBftw()\fR and \fBnftw()\fR