Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

C program to recreate Unix Tree Command.

Status
Not open for further replies.

jmorlock

Programmer
Apr 25, 2003
46
0
0
US
I am looking for suggestions on how to write a C program which will go thru each directory and print files within that directory. Do the same thing that the Unix "tree" command will do..

Sincerely,

Jeremy J. Morlock
IT Specialist

PatentWizard, LLC
E-mail: jeremy@PatentWizard.com
Web Site:
 
Code:
NAME
       ftw, nftw - file tree walk

SYNOPSIS
       #include <ftw.h>

       int  ftw(const char *dir, int (*fn)(const char *file, const struct stat
       *sb, int flag), int depth);
If you have this API function on your system, its going to be fairly easy to do.

--
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top