Looking for Boost File System Example

I wrote a simple program that works like the dos find command
> Searches for a text string in a file or files.

except mine will output line numbers, and counts the number of matches.

The only problem is I have not been able to make it search using wild cards. or subfolders. I read somewhere that boost file system would make that easier to program.

I'm in the process of trying to install boost now, wish me luck, but I'm wondering if anyone has a working program that would give me a good example similar to what I'm trying to do.

I did find
http://www.boost.org/doc/libs/1_51_0/libs/filesystem/doc/tutorial.html#Directory-iteration
under
Reporting the size of a file
but no where does it mention wild cards like filename*.txt.

Anyway, if you have a program to share, or working knowledge with boost, I'd love to hear from you.

There is no built-in search using wildcards. You can run a directory_iterator or recursive_directory_iterator and skip the entries that do not match your pattern. I would convert the wildcard expression to a regular expression, since it makes skipping easy with boost.regex.
Topic archived. No new replies allowed.