The Directory Walker revisited

Geoff Canyon gcanyon at inspiredlogic.com
Fri Sep 5 01:22:00 EDT 2003


On Tuesday, September 2, 2003, at 01:59  AM, wouter wrote:

> That is true but the amount of recursion is not  equal to the depth of 
> the directories.
> It is equal to the total amount of directories. And this number can 
> easily surpass 1000.

Again, sorry for the delayed response, but I just realized that the 
recursive code behind this conversation is mine, and I feel the need to 
defend my code ;-)

The above isn't correct; the recursion involved only reaches the depth 
of the directory structure. So if your folders are nested twenty deep, 
the greatest recursion depth will be twenty as well. It doesn't matter 
how "wide" the directory structure is, just how deep.

On Thursday, September 4, 2003, at 01:03  AM, wouter wrote:

> :^)) You keep persitent on the deepness of the directory.
> I used my root Library folder on a Mac OS X volume to run tests
>  and the deepest folder is 18 levels deep.
> The recursiveLimit has only to do by how many times the handler
> calls itself from within itself without ending itself (nested calls) 
> before
> its starts running itself again  (kind of an egocentric handler)

The problem here isn't with recursion. The setting/getting of 
directories, or maybe the overall data size, is involved as well. I ran 
a test without using actual directories, instead just generating fake 
ones. I've run tests that went as deep as 131 levels of recursion, 8308 
directory and file entries, and an output of 1,243,170 bytes, without a 
problem.

In a pure recursive method I went to a depth of 600 without problem.

regards,

Geoff Canyon
gcanyon at inspiredlogic.com




More information about the use-livecode mailing list