Filesystem Exception

Hello all, I'm creating a directory using boost::filesystem::create_directory function. When i looked at the documentation, It said, Throws: basic_filesystem_error<Path> if Effects fails for any reason other than because the directory already exists. Now when i catch the exception like this try { boost::filesystem::create_directory (path) } catch (boost::filesystem::basic_filesystem_error boost::filesystem::path& e) { cout << e.what() << endl ; } e.what() returns the string boost::filesystem::create_directory. What i expect is why the create_directory failed. How can i get the string describing the problem. Thanks in advance, Surya

Surya Kiran Gullapalli wrote:
try { boost::filesystem::create_directory (path) } catch (boost::filesystem::basic_filesystem_error boost::filesystem::path& e) { cout << e.what() << endl ; }
e.what() returns the string boost::filesystem::create_directory.
That seems really weird. I catch std::exception& and get a more complete error message. Don't know why that should affect anything.
participants (2)
-
Noah Roberts
-
Surya Kiran Gullapalli