Boost logo

Boost Users :

From: David Neubelt (david_at_[hidden])
Date: 2007-05-23 21:15:58


I'm iterating through a directory on windows (c:\) and it is throwing an
exception saying the file isn't found when I call is_directory on it.

 

Here is my code

 

        filesystem::path boostdir("c:\\");

 

        // -- make sure the path exists

        if(!filesystem::exists(boostdir)) {

            // .. error handle

        }

 

        // -- make sure its a directory

        if(!filesystem::is_directory(boostdir)) {

            // .. error handle

        }

 

        filesystem::directory_iterator enditr;

        for(filesystem::directory_iterator itr(boostdir); itr != enditr;
++itr ) {

            

            if(filesystem::is_directory(*itr))

                // .. code

        }

 

filesystem::is_directory(*itr) throws with

m_what = "boost::filesystem::is_directory:
"c:8f876d52712ede0273c42e26d4af6847": The system cannot find the file
specified."

 

I checked and verified the folder does exist, I'm guessing the problem
is that the directory is in the format c:folder instead of c:\folder.

 

Thanks,

David



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