1

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.

Nikko
  • 4,182
  • 1
  • 26
  • 44
493c33432b2b
  • 15
  • 1
  • 6

1 Answers1

1

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.

Mohamed Ali
  • 173
  • 5
  • If I pass my regex string to boost::filesystem::path will it find all file matches or do I have to iterate through each directory myself? – 493c33432b2b Dec 25 '14 at 20:49
  • you can find a detailed answer here:http://stackoverflow.com/questions/1257721/can-i-use-a-mask-to-iterate-files-in-a-directory-with-boost – Mohamed Ali Dec 25 '14 at 21:01