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@lists.boost.org
http://lists.boost.org/mailman/listinfo.cgi/boost-users