Nathan Nobbe wrote:
if youre trying to do recursive iteration whereby you 'flatten' the tree structure, drop the RecursiveDirectoryIterator into a RecursiveIteratorIterator (its for iterating over RecursiveIterators), then you dont have to bother w/ calling hasChildren() at all. you probly also want to look at the constructor args, since by default, it only returns leaf nodes.$dir = new RecursiveDirectoryIterator('/path/to/dir'); $itt = new RecursiveIteratorIterator($dir, RecursiveIteratorIterator::CHILD_FIRST);foreach ($itt as $item) { print get_class($item) . "\r\n"; }-nathan
Hi, thanks for the idea. In my case I do not want to flatten the tree. When there is a sub-directory I make a repeat call to the function/method, there-by calling it for each directory. I'd give you more details but I don't think it'd help with this specific issue.
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

