lmi
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lmi] boost::filesystem oddity


From: Greg Chicares
Subject: [lmi] boost::filesystem oddity
Date: Sun, 15 Jan 2006 11:46:15 +0000
User-agent: Mozilla Thunderbird 1.0.2 (Windows/20050317)

Vadim--Here's something that puzzles me. I think this code should run
without throwing any exception. But I can't get it to work that way
on msw when the boost filesystem library is built as a dll. I think
you've got a version of boost built with their 'jam' build system;
would you mind trying it and letting me know what happens?

#include <boost/filesystem/path.hpp>
#include <exception>
#include <iostream>
#include <ostream>

int main()
{
    try
        {
        boost::filesystem::path::default_name_check
            (boost::filesystem::windows_name
            );
        boost::filesystem::path p0("C:/AUTOEXEC.BAT");
        std::cout << p0.string() << std::endl;
        boost::filesystem::path p1("C:\\AUTOEXEC.BAT");
        std::cout << p1.string() << std::endl;
        }
    catch(std::exception const& e)
        {
        std::cerr << e.what() << std::endl;
        }
}

I get
  boost::filesystem::path: invalid name "C:" in path: "C:/AUTOEXEC.BAT"
which seems unexpected.

I've found a way to make code like this work in lmi, but I'd really
like to understand the problem that I appear to have fixed.

For the record, here's a problem report that I posted:
  http://sourceforge.net/mailarchive/message.php?msg_id=14476898
and here's another that may be related:
  
http://groups.google.com/group/boost-list/browse_thread/thread/6e40af492f800509/37bbeddaec4db0bd




reply via email to

[Prev in Thread] Current Thread [Next in Thread]