Boost logo

Boost Users :

From: brad_at_[hidden]
Date: 2008-06-30 14:15:28


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


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net