Return all paths, recursively to deepest level

Ken Ray kray at
Sat Feb 23 02:16:01 EST 2002

Siva, here you go:

global gHierList,gMainFolder,gBaseLevels

on mouseUp
  put "" into gHierList
  answer folder "Pick a folder you want to walk:"
  if it = "" then exit mouseUp
  set the itemDel to "/"
  put it into gMainFolder
  put the number of items of gMainFolder into gBaseLevels
  directoryWalk gMainFolder
  put gHierList into field 1
end mouseUp

on directoryWalk whatFolder
  set the itemDel to "/"
  if "(2)" is in pDel then put 2 into numSpcs
  else put 4 into numSpcs
  put "                                        " into spcPad
  set the directory to whatFolder
  put the files into temp
  sort temp
  repeat with x = 1 to the number of lines of temp
    put whatFolder & "/" & (line x of temp) into line (the number of lines
of gHierList)+1 of gHierList
  end repeat
  put the directories into tDirList
  sort tDirList
  repeat with x =  2 to the number of lines of tDirList
    directoryWalk (whatFolder & "/" & (line x of tDirList))
  end repeat
end directoryWalk


Ken Ray
Sons of Thunder Software
Email: kray at
Web Site:

----- Original Message -----
From: "Sivakatirswami" <katir at>
To: "Metacard List" <metacard at>;
<use-revolution at>
Sent: Friday, February 22, 2002 11:38 PM
Subject: Return all paths, recursively to deepest level

> Aloha:
> I think about 2 years ago Kevin or Richard  sent me a script that would
> return the full path for all folders and files, recursively down from the
> current working directory... but I can't seem to find that script... Also
> can't seem to find the archives any more for the metacard card list
> Does anyone have such a script? One could use Rinaldi's getDir external,
> just replace the ":" with "/" in the list returned but that would not be
> cross platform...  the returned output from the function would look like
> this:
> MyHardDrive/MetaCard 2.3.1/  KT Stacks
> MyHardDrive/MetaCard 2.3.1/  KT Stacks/ INNERSEARCH
> MyHardDrive/MetaCard 2.3.1/  KT Stacks/ INNERSEARCH/Drums hi 2
> MyHardDrive/MetaCard 2.3.1/  KT Stacks/ INNERSEARCH/Drums hi fidelity.aiff
> MyHardDrive/MetaCard 2.3.1/  KT Stacks/ INNERSEARCH/images
> MyHardDrive/MetaCard 2.3.1/  KT Stacks/ INNERSEARCH/images/0616001 Ocean
> .pict
> MyHardDrive/MetaCard 2.3.1/  KT Stacks/Dev Tools-Practice
> MyHardDrive/MetaCard 2.3.1/  KT Stacks/Dev Tools-Practice/
> etc. down through to the deepest sub folder and it's files.
> Hinduism Today
> Sivakatirswami
> Editor's Assistant/Production Manager
> katir at
> Read The Master Course Lesson of the Day at
> _______________________________________________
> metacard mailing list
> metacard at
> _______________________________________________
> use-revolution mailing list
> use-revolution at

More information about the Use-livecode mailing list