Boost logo

Boost :

From: Martin Slater (mslater_at_[hidden])
Date: 2004-12-01 17:54:04


I've been using boost.filesystem and have come up on a problem with
exists(). Basically on a windows system it will return true if asking
whether a file exists on a non-existent share. The problem is at,
operations_posix_windows.cpp:327. There should (?) be an additional
check against ERROR_BAD_NETPATH as well. The fuzziness of this function
is quite disturbing as shown by the following comment in the code
            return false; // GetFileAttributes failed because the path
does not exist
         // for any other error we assume the file does exist and fall
         // this may not be the best policy though... (JM 20040330)

The windows docs don't really help that much by not specify exactly what
the failures can be though. Personally I think it should always return
false on GetAttributes() error to avoid false positives and the expense
of the possible false negatives, but we need a list of all possible
errors to be sure that this is the right thing to do.

Oh and any chance you can put in serialization support for
boost::filesystem::path? I've done it locally and the code is trivial
but it would be nice to have it out the box.

Anyhow, thanks for a great library (filesystem and the rest of boost).



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