Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!jarthur!nntp-server.caltech.edu!tybalt.caltech.edu!toddpw From: toddpw@tybalt.caltech.edu (Todd P. Whitesel) Newsgroups: comp.sys.apple2 Subject: Re: Searching through directories Keywords: directories Message-ID: <1990Oct10.034113.12220@nntp-server.caltech.edu> Date: 10 Oct 90 03:41:13 GMT References: <2080@oucsace.cs.OHIOU.EDU> Sender: news@nntp-server.caltech.edu Organization: California Institute of Technology, Pasadena Lines: 17 Nntp-Posting-Host: tybalt.caltech.edu bchurch@oucsace.cs.OHIOU.EDU (Bob Church) writes: >I'm putting together a program in which I need to search through >directories. The problem is that the number of files is open ended. >A subdirectory can be a mixture of any number of regular files and >subs. Can anyone help me with a good strategy on this? I don't need >code, just a way of thinking this thing through. Where do you start >and how do you keep track? You start by calling a routine with the volume directory -- this routine processes each file in the directory and each time it reaches a subdirectory it calls itself with the subdirectory. This requires that you save stuff on the stack, but if you are doing it in a high level language then the stack manipulation is trivial (it's built into the languages' subroutine calls). Todd Whitesel toddpw @ tybalt.caltech.edu