The Directory Walker revisited

Scott Rossi scott at tactilemedia.com
Wed Sep 3 08:59:00 EDT 2003


>> others have posted recursive walkers "years" ago which used a
>> depth-first search with pre- or end-order processing, and have not hit
>> these limits. As Dar suggests, I doubt they would have any problem
>> processing an entire OS X volume.
> 
> I have been searching for this recursive walkers from  "years" ago but
> couldn't find those with "depth-first search with pre- or end-order
> processing". Can you please post the url.

Here's one from the archives that works for me (added a simple busy cursor
indicator):

global gHierList
on mouseUp
  put empty into gHierList
  put empty into field 1
  answer folder "Pick a folder you want to walk:"
  if it is empty then exit mouseUp
  set lockCursor to true
  set cursor to watch
  directoryWalk it
  sort gHierList
  put gHierList into field 1
  put number of lines of fld 1
  set lockCursor to false
end mouseUp

on directoryWalk whatFolder
  set the defaultFolder to whatFolder
  put the files into temp
  repeat for each line x in temp
    put whatFolder & "/" & x & return after gHierList
  end repeat
  put the folders into tDirList
  repeat with x =  2 to the number of lines of tDirList
    directoryWalk (whatFolder & "/" & (line x of tDirList))
  end repeat
end directoryWalk

I believe the script posted on Ken Ray's tips site (which is also in the
archives) will run into the recursion limit problem.  Ken - maybe you can
update your tips page with a revised script.

Regards,

Scott Rossi
Creative Director

Tactile Media, Multimedia & Design
Email: scott at tactilemedia.com
Web: www.tactilemedia.com




More information about the use-livecode mailing list