Boost logo

Boost Users :

Subject: Re: [Boost-users] exceptions from boost::filesystem not catchable on os/x 10.6.8 boost-1.47.0
From: david x callaway (dxc_at_[hidden])
Date: 2011-09-05 06:17:45


according to http://www.boost.org/doc/libs/1_47_0/libs/filesystem/v3/doc/reference.html#Error-reporting (search for "exists"):
bool exists(const path& p);
bool exists(const path& p, system::error_code& ec);
Returns: exists(status(p)) or exists(status(p, ec)), respectively.

Throws: filesystem_error; overload with error_code& throws nothing.

I guess this hinges on what you think of as an error then, and you could argue that a file not existing *isn't* an error, it's just a condition.

thx
dxc

On Sep 5, 2011, at 4:36 AM, Martin Dyring-Andersen wrote:

>> -----Original Message-----
>>
>> any ideas?
>>
>
> According to the documentation boost::filesystem::exists returns a bool to indicate if the path exists, an exception is thrown if something ... exceptional ... happens. ;-)
>
>> From the documentation:
>
> bool exists(const path& p);
> bool exists(const path& p, system::error_code& ec);
> Returns: exists(status(p)) or exists(status(p, ec)), respectively.
>
> Throws: filesystem_error; overload with error_code& throws nothing.
>
> --
> Best regards,
> Martin Dyring-Andersen
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net