Boost::filesystem Searching...

Pages: 12
nvm, i found it out. Thank you all for all of your help!! I really appreciate it! :D
In windows, on my system, my program would crash when I attempted to iterate over "system volume information", a hidden file on the C: drive. Boost returns true for is_directory on this entry, but crashes when attempting to iterate over it.

I ended up doing this.

if (is_directory (SMdata->DirectoryPath[Selected])) {
    if (SMdata->DirectoryPath[Selected].path().filename().string() != "System Volume Information")
        std::copy(boost::filesystem::directory_iterator(SMdata->DirectoryPath[Selected]), boost::filesystem::directory_iterator(), back_inserter(ItDir));

I think there may be other hidden files you need to watch out for as well.
Last edited on
Topic archived. No new replies allowed.
Pages: 12