problem with boost 1.33 filesystem

Václav Haisman V.Haisman@sh.cvut.cz
Fri Nov 11 00:48:00 GMT 2005



Lewis Hyatt wrote:
> Hi All,
> 
> I apologize if this has been brought up before, but I couldn't find any
> mention of it. I think the filesystem component of boost v1.33 currently
> available as part of the cygwin distribution has been compiled
> incorrectly. As mentioned here:
> http://boost.org/libs/filesystem/doc/index.htm#Cgywin (sic), it is
> necessary to compile with -DBOOST_POSIX on cygwin for POSIX emulation to
> work properly; otherwise it uses Windows file names only and does not
> work as expected. Here is a simple demonstration:
> 
> ////////////////////////////
> #include <iostream>
> #include <boost/filesystem/operations.hpp>
> #include <boost/filesystem/exception.hpp>
> namespace bfs = boost::filesystem;
> 
> int main(int argc, char **argv)    {
>     //arg checking omitted
>     try    {
>         bfs::directory_iterator di(argv[1]);
>     }
>     catch (bfs::filesystem_error &ex)    {
>         std::cerr << ex.what() << '\n';
>     }
> }
> ////////////////////////////
> 
> If you pass something Windows can handle as the argument, such as ".",
> then this program works as expected. If you pass a cygwin path, such
> as "~" or "/cygdrive/c", it throws an exception:
> 
> boost::filesystem::directory_iterator constructor: "\home\Lewis": The
> system cannot find the path specified.
> 
> or
> 
> boost::filesystem::directory_iterator constructor: "\cygdrive\c": The
> system cannot find the path specified.
> 
> I believe this is precisely the consequence of omitting -DBOOST_POSIX
> but cannot confirm with certainty.
> 
> Thanks very much to whoever maintains this.
> 
> -Lewis

It should be fixed in package version 1.33.0-2. I have built monotone
and it seems to work fine with POSIX paths.

Vaclav Haisman
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 546 bytes
Desc: OpenPGP digital signature
URL: <http://cygwin.com/pipermail/cygwin/attachments/20051111/888e9704/attachment.sig>


More information about the Cygwin mailing list