[PHP] Time limit on recursive procedure?
I have a recursive procedure, and I set the time limit each time I enter it: function rec_scan($directory, ..) { set_time_limit (1); if (is_dir($new_file)) { rec_scan ($new_file, ) } } The way I read the manual, the timer should be reset each time I call rec_scanl, but I seem to have to set a longer time limit than I would have anticipated, and I wonder if in fact the original time limit still applies to the original invocation? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Time limit on recursive procedure?
Clancy wrote: I have a recursive procedure, and I set the time limit each time I enter it: function rec_scan($directory, ..) { set_time_limit (1); if (is_dir($new_file)) { rec_scan ($new_file, ) } } The way I read the manual, the timer should be reset each time I call rec_scanl, You keep calling it so as long as the execution time between each call is 1 second, your script will keep going. /Per -- Per Jessen, Zürich (15.4°C) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Time limit on recursive procedure?
On Sun, 07 Jun 2009 13:04:20 +0200, p...@computer.org (Per Jessen) wrote: Clancy wrote: I have a recursive procedure, and I set the time limit each time I enter it: function rec_scan($directory, ..) { set_time_limit (1); if (is_dir($new_file)) { rec_scan ($new_file, ) } } The way I read the manual, the timer should be reset each time I call rec_scanl, You keep calling it so as long as the execution time between each call is 1 second, your script will keep going. /Per Thanks. That's what I thought. I'm using it to back up my working directory to another drive, and a 3 second limit wasn't long enough, so one of the directories must take longer than I expected to copy. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php