Recursive Directory Scan

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
FlyingIsFun1217
Super wx Problem Solver
Super wx Problem Solver
Posts: 497
Joined: Mon Nov 06, 2006 9:58 pm

Recursive Directory Scan

Post by FlyingIsFun1217 » Thu Aug 21, 2008 1:48 am

Hey!

For my newest app, I need to recursively scan a directory for files of a certain type (determined by the file extension). Thing is, what I want to do, is to scan through a main directory, find the contents, if any of them are directories, scan those too, and keep going until all of the directories are scanned.

What classes should I be looking into for this?

Thanks!
FlyingIsFun1217

mc2r
wxWorld Domination!
wxWorld Domination!
Posts: 1195
Joined: Thu Feb 22, 2007 4:47 pm
Location: Denver, Co
Contact:

Post by mc2r » Thu Aug 21, 2008 3:03 am

wxDir has a few functions that will work GetFirst(), GetNext(), and also Traverse().

The wxDir page has a sample using GetFirst() and GetNext(). The wxDirTraverser page has a sample using Traverse(). GetFirst(), GetNext() is probably simpler.

-Max

FlyingIsFun1217
Super wx Problem Solver
Super wx Problem Solver
Posts: 497
Joined: Mon Nov 06, 2006 9:58 pm

Post by FlyingIsFun1217 » Thu Aug 21, 2008 4:44 pm

Thanks, I'll start looking into those!

FlyingIsFun1217

Post Reply