Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!uunet!cme!cam!coleman From: coleman@cam.nist.gov (5672) Newsgroups: comp.unix.questions Subject: Re: Descending directory hierarchy? Summary: ftw(3) Keywords: directory list find search Message-ID: <1810@gamma.cam.nist.gov> Date: 1 Dec 89 16:56:59 GMT References: <1372@lakesys.lakesys.com> Distribution: usa Organization: National Institute of Standards & Technology, Gaithersburg, MD Lines: 18 In article <1372@lakesys.lakesys.com>, johnb@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@bldr.nist.gov