Descending directory hierarchy?

5672 coleman at cam.nist.gov
Sat Dec 2 03:56:59 AEST 1989


In article <1372 at lakesys.lakesys.com>, johnb at lakesys.lakesys.com (John C. Burant) writes:
> I've been thinking about the find command on SysV's... the one that makes you
> type find / name [filename] -print to find files, and only finds files with
> the exact filename specified... and I've been thinking about writing a program
> that will act like the BSD find... it list all files with the phrase you look
> for in the filename... (like if I looked for t, I'd get a lot of files listed)
> 
> Which brings me to the question: Is there a way to descend the directory 
> hierachy into every directory, or do I have to write a routine to do that?

I suggest the use of the library function ftw(3). Their is one bug
that I encountered on the SUN running bsd 4.3. ftw(3) won't handle
symbolic links so I had to prepare a version on ftw() that does. You
may not have any problems with it if you don't have symbolics links.

Sean Coleman
NIST
coleman at bldr.nist.gov



More information about the Comp.unix.questions mailing list