Re: [Boost-bugs] [Boost C++ Libraries] #897: exists() throws exeption on existing but locked file on wind

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #897: exists() throws exeption on existing but locked file on wind
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2007-10-31 22:14:10


#897: exists() throws exeption on existing but locked file on wind
---------------------------+------------------------------------------------
  Reporter: hkaiser | Owner: bemandawes
      Type: Bugs | Status: closed
 Milestone: Boost 1.35.0 | Component: filesystem
   Version: None | Severity: Showstopper
Resolution: fixed | Keywords:
---------------------------+------------------------------------------------
Changes (by bemandawes):

  * status: new => closed
  * resolution: None => fixed
  * milestone: => Boost 1.35.0

Old 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().
>
> }}}

New 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().

 }}}

--
Ticket URL: <http://svn.boost.org/trac/boost/ticket/897#comment:2>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.


This archive was generated by hypermail 2.1.7 : 2017-02-16 18:49:56 UTC