On Wed, May 24, 2006 at 07:13:24AM +0200, Michael Kerrisk wrote: > Justin, > > In a moment, I'll forward my revised version of the page. > > In fact, I took on most of the material that you suggested, > but revised some of it significantly. But please, > for the future, if you want to get do things as follows when writing a major > patch: > > a) Notify me in advance: I maight have some comments about > how planned changes should be done. > > b) Break logically separate parts up, and submit them separately. > Big patches covering multiple logical areas are too much work > to understand. > > I'll just make a few specific comments on the patch below. > > > -.BI "int ftw(const char *" dir ", int (*" fn ")(const" > > -.BI "char *" file ", const struct stat *" sb ", int " flag ), > > -.BI "int " nopenfd ); > > -.sp > > -.BI "int nftw(const char *" dir ", int (*" fn ")(const" > > -.BI "char *" file ", const struct stat *" sb ", int " flag , > > -.BI "struct FTW *" s ), > > -.BI "int " nopenfd ", int " flags ); > > +\fBtypedef int (*\fIftw_func_t\fP)(const char *\fPfile\fP, const > > +struct stat *\fPsb\fP, int \fPflag\fP); > > +.sp > > +\fBint ftw(const char *\fIdir\fP, ftw_func_t \fPfn\fP, int \fPnopenfd\fP); > > +.sp > > +\fB#define _XOPEN_SOURCE 500 > > +.sp > > +\fBtypedef int (*\fInftw_func_t\fP)(const char *\fPfile\fP, const > > +struct stat *\fPsb\fP, int \fPflag\fP, struct FTW *\fPs\fP); > > +.sp > > +\fBint nftw(const char *\fIdir\fP, nftw_func_t \fPfn\fP, int > > +\fPnopenfd\fP, int \fPflags\fP); > > While I appreciate that the type ftw_func_t is defined in > the header, and its use makes the declarations look simpler, > it is non-standard, so I'm reluctant to use it in the man page. Good point.
> .SH DESCRIPTION > > -\fBftw\fP() walks through the directory tree starting from the indicated > > -directory \fIdir\fP. For each found entry in the tree, it calls > > -\fIfn\fP() with the full pathname of the entry, a pointer to the > > -.BR stat (2) > > -structure for the entry and an int \fIflag\fP, which value will be one of > > -the following: > > +\fBftw\fP() walks recursively through the path hierarchy beginning at > > +\fIdir\fP, and calls \fIfn\fP() for each directory entry found. > > +Directories are handled before the files and subdirectories they > > +contain (\*(lqbreadth\-first\*(rq). > > In truth, it is not "breadth first" but "pre-order". > (The name FTW_DEPTH is a misnomer -- really it means "post-order".) Another good point; I didn't have network access when I wrote this, and didn't look it up later.. Justin -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

