recursion limit when creating file list of harddrive

Geoff Canyon gcanyon at gmail.com
Tue Oct 27 12:18:19 EDT 2015


Revised. Now in function form, with error checking and depth control. You
can hand in a positive number to get that number of layers deep, or a
negative number to go all the way down. I tested it on my home directory
and it came back fine (after some time). I haven't (knowingly) tested with
unusual characters.

on mouseUp
   put directoryListing(fld "directory",round(the thumbposition of
scrollbar "depth")) into field "listing"
end mouseUp

function directoryListing whatFolder,c
   put whatFolder & cr into R
   set the directory to whatFolder
   if c = 0 or the result is not empty then return R
   put the files into tFileList
   sort tFileList
   replace cr with cr & whatFolder & "/" in tFileList
   put whatFolder & "/" & tFileList & cr after R
   put line 2 to -1 of the folders into tDirList
   sort tDirList
   repeat for each line L in tDirList
      put directoryListing((whatFolder & "/" & L),(c-1)) after R
   end repeat
   return R
end directoryListing


On Mon, Oct 26, 2015 at 12:00 AM, Geoff Canyon <gcanyon at gmail.com> wrote:

> On Sat, Oct 24, 2015 at 7:28 PM, Matthias Rebbe | M-R-D <
> matthias_livecode_150811 at m-r-d.de> wrote:
>
>> I am using a script snippet which was posted by Scott Rossi to the list
>> and was originally from Geoff Canyon in 2002.
>> http://lists.runrev.com/pipermail/metacard/2002-August/002274.html
>>
>
> Man, do I hate looking at my old code...
>



More information about the use-livecode mailing list