Boost logo

Boost :

From: Beman Dawes (bdawes_at_[hidden])
Date: 2005-09-28 20:56:56

"Reece Dunn" <msclrhd_at_[hidden]> wrote in message
> The proper way to implement exists( ... ) on Windows is to do:
> #include "shlwapi.h"
> // link to shlwapi.lib
> bool exists( const path & ph )
> {
> return ::PathFileExistsA( ph.string().c_str()) == TRUE;
> }

In proposal to the standards committee, exists() is specified in terms of
the results of POSIX stat(). On Windows, the best way to achieve that might
be to use Windows Run-Time library's _stat() and _wstat() functions. The
docs for those functions specifically say "A return value of -1 indicates an
error, in which case errno is set to ENOENT, indicating that the filename or
path could not be found."


Boost list run by bdawes at, gregod at, cpdaniel at, john at