Boost logo

Boost Users :

From: Lewis Hyatt (lhyatt_at_[hidden])
Date: 2007-03-15 15:24:14


Timo <timo_lampinen <at> hotmail.com> writes:

>
> fs::native throws an exception. But fs::no_check works. Just wondering if
> this is a "feature" that the boost developers are aware of.
>
> Timo

It's not an issue with boost::filesystem so much as a design choice made by the
cygwin boost package maintainer. The package is compiled with BOOST_POSIX
defined, telling the library to expect POSIX paths. See
http://boost.org/libs/filesystem/doc/index.htm#Cgywin [sic].

The reason it still works after you pass fs::no_check is that the cygwin
emulation layer can correctly interpret both kinds of paths, even though
boost::filesystem isn't aware of that fact.

If you are compiling programs in cygwin, you should expect to use POSIX paths
anyway, otherwise you could just compile in MinGW instead. So instead of
c:\whatever, use /cygdrive/c/whatever. Or instead of c:\cygwin\whatever, just
/whatever.

-Lewis


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