recuring through / with boost filesystem
Wondering if someone could suggest how to skip Linux Kernel related filesystems (like proc, sysFS stuff, etc) when using boost::filesystem to recurse thru / I've tried this: if (boost::filesystem::is_regular(itr->status()) && !boost::filesystem::is_empty(itr->path()) &&!boost::filesystem::symbolic_link_exists(itr->path())) But I still get hung up on some files in proc and sys. My goal is to read every readable file... starting at root. Silly goal, I know. Just experimenting with boost::filesystem. Any tips of clue-by-fours are appreciated. BTW, I can do this and it works: // Skip leafs with certain names. Leafs may be folders or files. if (itr->path().leaf() == "sys") { std::clog << "Skip: " << itr->path() << std::endl; continue; } But I'd like a more automated approach to skip these 'oddball' directories. Thanks, Brad
participants (1)
-
brad@16systems.com