Hey, that's a good approach - I'll use it! Thank you :) On Saturday 03 May 2003 02:38 am, Esben Mose Hansen wrote: > On Saturday 03 May 2003 02:41, Mosfet wrote: ...snip... > > You can combine the above approaches: When scanning the first directory, > push any directories to a stack. When done with this directory, take the > top directory and process that in the same way. As this is tail recursion, > it can be replaced with a simple look. In psedo code, in pseodu C++: > > stack dirs_to_be_processed; > do { > for each file in diretory{ > if (file is a directory) > dirs_to_be_processed.push(file); > processFile(file); > } > } while (!.stack.empty()) > > This kind of approach often works like a charm when you want to rid > yourself of those nasty recursions :-) >> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<