Getting Directory Tree

Gordon Tillman got at mindspring.com
Wed Feb 2 14:29:00 EST 2005


Hi Derek,

I left one small piece out, sorry!

function GetFolderContents pFolder
     local tSaveDefaultFolder, tFolder, tFolders, tList
     put the defaultFolder into tSaveDefaultFolder
     set the defaultFolder to pFolder
     get the folders
     filter it without "."
     filter it without ".."
     put it into tFolders
     local tFiles, tFile
     get the files
     put it into tFiles
     put pFolder & return after tList
     repeat for each line tFile in tFiles
         put pFolder & "/" & tFile & return after tList
     end repeat
     repeat for each line tFolder in tFolders
         put GetFolderContents(pFolder & "/" & tFolder) after tList
     end repeat
     set the defaultFolder to tSaveDefaultFolder
     return tList
end GetFolderContents

--gordy



More information about the use-livecode mailing list