0

I have a root directory. I want to find out all directories under the root directory that do not have sub-directories and does not contain any .xml type files. I can get list of all directories under root directory from "FindFirstFile" and then for each item in the list, see if there are sub-directories for that item and if not then does it have any file of type ".xml". Is there a faster and elegant way for this? I working on Windows, VS 2010 and am open to using libraries like boost.

Thanks,

Naveen
  • 74,600
  • 47
  • 176
  • 233
a n
  • 127
  • 2
  • 7
  • Related question here: http://stackoverflow.com/questions/1257721/can-i-use-a-mask-to-iterate-files-in-a-directory-with-boost – Naveen Jul 13 '12 at 03:28
  • It sounds like you may have the fastest way already. If it seems slow to you, show us your code. – egrunin Jul 13 '12 at 03:49
  • You might want to look at a [previous question](http://stackoverflow.com/q/2531874/179910) for a couple of directory iterators that include filtering. My other bit of advice would be that (depending on the system) a breadth-first search can be faster than the more common depth-first search (which is what a recursive traversal will normally give you). – Jerry Coffin Jul 13 '12 at 04:08

0 Answers0