Re: recursion (?) through a directory tree
  Home FAQ Contact Sign in
alt.comp.lang.c only
 
Advanced search
POPULAR GROUPS

more...

alt.comp.lang.c Profile…
 Up
Re: recursion (?) through a directory tree         


Author: MikeC
Date: Feb 29, 2008 12:57

If this is on the DOS window of a PC, try looking at the help for
findfirst() and findnext(), which give example programs that can be twisted
to do what you want.

Another function is ftw() {file tree walk}, which is designed to do exactly
what you want. There is a good example program in the help files.

If you are using RHIDE, enter Alt-H for help, C for C- help, A for
Alphabetical list, and run down the list till you get to the entries
mentioned.

MikeC
Show full article (1.00Kb)
2 Comments
Re: recursion (?) through a directory tree         


Author: MikeC
Date: Feb 29, 2008 13:39

Sorry if my last comment misled/mystified you. I'm subscribed to two
groups - C and DJGPP, which is a freeby 32-bit C compiler that works under
DOS. When I made my answer, it was under the impression that I was reading
the DJGPP group.

findfirst() and findnext() are not ANSI or POSIX compliant, but they are
pretty popular, and it is probable that your compiler will support them -
I'm not so sure about ftw(). In any event, I wrote a backup program that
backed up the directory pointed to and all its subdirectories (and deleted
files if they were more than a certain age, etc), and I used
findfirst()/findnext() without much trouble.

MikeC

"MikeC" btconnect.com> wrote in message
news:9oKdncSmNJ8D7FXaRVnyhwA@bt.com...
> If this is on the DOS window of a PC, try looking at the help for
> findfirst() and findnext(), which give...
Show full article (1.79Kb)
no comments
Re: recursion (?) through a directory tree         


Author: Donkey Hot
Date: Mar 3, 2008 00:32

"MikeC" btconnect.com> wrote in
news:WdidnVWYh4o-5lXanZ2dneKdnZydnZ2d@bt.com:
> I'm subscribed to two
> groups - C and DJGPP, which is a freeby 32-bit C compiler that works
> under DOS.

Off topic, but a 32-bit C compiler cannot work under DOS. DOS is a 16-bit
operating system (which is not used any more by most people).
no comments