493c33432b2b
493c33432b2b

Reputation: 15

C++ How to Find Files Using Path With Multiple Wildcards

I want of find files using search paths such as:

C:\Users\*\AppData\*\Temp\f?le.*

I am using Windows so I cannot us the glob.h header. I have used the Windows API function PathMatchSpec, but it only allows wildcards in the last part of the path (f?le.*). Is there anything I can do?

P.S. Please correct me if I am breaking any SO rules--I'm new to this site.

Upvotes: 1

Views: 3753

Answers (1)

Mohamed Ali
Mohamed Ali

Reputation: 173

You can use boost::filesystem. here a link to the library: http://www.boost.org/doc/libs/1_57_0/libs/filesystem/doc/index.htm

you can iterate on a path. You can declare a regular expression boost::regexp and pass it to the boost::filesystem::path.

Upvotes: 1

Related Questions