recursion limits

David Vaughan dvk at dvkconsult.com.au
Thu Aug 4 18:35:43 EDT 2005


On 04/08/2005, at 12:47, Chris Sheffield <revlist at cableone.net> wrote:

>   I'm talking about recursion as in calling the same handler/ 
> function from within itself.  I'm guessing there could be issues  
> with this if the folder to back up has a large directory structure,  
> as in many sub folders and files.

Chris, several people have proposed you avoid recursion just in case.  
It was also advised that you read the thread on directory walker from  
early last year. I suggest you do the latter. I wrote (as did others)  
and use a recursive directory walker and have found no problems on  
whole disks of applications and data numbering at least a hundred  
thousand files. However, there is a "gotcha" in OS X and also with  
permissions on any platform, either of which can relegate you to an  
infinite loop. This may account for some of the bad experiences  
implied by other people. Alex's suggestion that you gather the entire  
file list first is a good safety measure but I suggest there are no  
other reasons to avoid the comparative speed and elegance of a  
recursive approach. We have not found limits for it.

regards
David


More information about the use-livecode mailing list