Opened 16 years ago

Closed 15 years ago

#897 closed Bugs (fixed)

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

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

Description (last modified by Beman Dawes)

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 (2)

comment:1 by Marshall Clow, 15 years ago

Owner: changed from beman_dawes to Beman Dawes
Severity: Showstopper
Status: assignednew

assigning to actual user "bemandawes" instead of unknown user "beman_dawes"

comment:2 by Beman Dawes, 15 years ago

Description: modified (diff)
Milestone: Boost 1.35.0
Resolution: Nonefixed
Status: newclosed
Note: See TracTickets for help on using tickets.