boost filesystems iterate directory

I have this sample code from the boost filesystem tutorial which prints out all the files within a specific directory. I'm just not familiar with the syntax, and wondering if someone could clarify it for me?

1
2
3

copy(directory_iterator(ProjectDirectoryMain), directory_iterator(), ostream_iterator<directory_entry>(cout, "/n"));


So the first argument is where the iteration begins, and the second argument would be where it ended. The second argument has a void argument, so I'm only going through the one folder. The third argument prints each file in the specified directory in a new line.

I want to know how I can store the file name and path of each file into a variable, in boost, (path). Do I just replace (cout, "/n") with what every I want to do with each "directory_entry"?
Last edited on
Topic archived. No new replies allowed.