Opened 16 years ago

Last modified 15 years ago

#897 closed Bugs (fixed)

exists() throws exeption on existing but locked file on wind — at Initial Version

Reported by: Hartmut Kaiser Owned by: beman_dawes
Milestone: Boost 1.35.0 Component: filesystem
Version: None Severity: Showstopper
Keywords: Cc:

Description

boost::filesystem::exists(somepath) throws an exception from 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().

Change History (0)

Note: See TracTickets for help on using tickets.