[filesystem] exists() throws exeption on existing but locked file on windows

13 Apr
2007
13 Apr
'07
4:36 p.m.
Hi all, What's the rationale of throwing an exception from boost::filesystem::exists(somepath); when 'somepath' exists but is locked by some other process (at least on Windows)? A simple way to reproduce the effect is: #include <iostream> #include <boost/filesystem.hpp> int main() { boost::filesystem::path p("C:\\pagefile.sys"); try { boost::filesystem::exists(p); } catch (...) { std::cerr << "Ooops..." << std::endl; } return 0; } Throwing an exception doesn't seem to be the right thing here, since the file actually exists, so I'ld expect to get a 'true' back from exists(). Regards Hartmut
6635
Age (days ago)
6635
Last active (days ago)
0 comments
1 participants
participants (1)
-
Hartmut Kaiser