When does recursion limit bite you?

Andre Garzia andre at andregarzia.com
Tue Oct 4 11:22:46 EDT 2011


Stephen,

If you can afford to waste some performance and know what platform you are
using, then, you can build a two pass algorithm.

The first pass just collect the file references, full path, one per line.

Then you filter this for the extensions you need and after that you process
it as usual.

If you are in mac os x, then you can use:

set the defaultfolder to "parent folder"
put shell("tree -i -f") into theFileList

This should work on Mac OS X and Linux but not on Windows.

:-D

On Tue, Oct 4, 2011 at 11:54 AM, stephen barncard <
stephenREVOLUTION2 at barncard.com> wrote:

> Funny that this comes up at this moment - I've been trying to work with a
> 'Directory Walker' recursive script (thanks Scott Rossi) and really can't
> make it very useful, I keep raising the recursionlimit to millions, but it
> eventually will crash on more dense stacks. I included a visible counter to
> keep track of iterations, but they only go into the thousands, not millions
>
> This is using Scott's walker from 2002, and the only modification was a
> test
> for file suffix to get a list of certain files  by file types.
>
> Mark, you say that there's a bug in the IDE that makes this worse? Does
> that
> mean 'walkers' work properly in a standalone?
>
> Another question is  - is there another, non-recursive way to walk all
> folders? Some kind of two-pass method? Or is this just the way it is?
>
> On 4 October 2011 05:30, Andre Garzia <andre at andregarzia.com> wrote:
>
> > http://docs.runrev.com/Property/recursionLimit
>
>
>
>
> --
>
>
>
> Stephen Barncard
> San Francisco Ca. USA
>
> more about sqb  <http://www.google.com/profiles/sbarncar>
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>



-- 
http://www.andregarzia.com All We Do Is Code.



More information about the use-livecode mailing list