|
Boost Users : |
From: Ken Klose (ken.klose_at_[hidden])
Date: 2007-04-25 14:08:47
I read this in the boost docs:
Rationale: It is not considered an error for rhs to include a root-directory
because m_name might be relative or empty, and thus it is valid for rhs to
supply root-directory. For example, on Windows, the following must succeed:
path p( "c:", native );
p /= "/foo";
assert( p.string() == "c:/foo" );
So I tried the code and the first line blew up:
boost::filesystem::path: invalid name "c:" in path: "c:"
Thanks
"Ken Klose" <ken.klose_at_[hidden]> wrote in message
news:f0nuro$tb2$1_at_sea.gmane.org...
> cout << "init path " << initial_path().string() << endl;
> cout << "init path exists " << exists(initial_path()) << endl;
>
> prints:
>
> init path C:/Documents and Settings/me/workspace/3.2/DciApiTest
> init path exists 1
>
> But if I try to construct the same path from a string: I get:
>
> path init_path2(initial_path().string(), no_check); // I've also tried
> 'native' checker
> cout << "init path 2 " << init_path2.string() << endl;
> cout << "init path 2 exists " << exists(init_path2) << endl;
>
> I get:
>
> init path 2 C:Documents and Settings/ken.klose/workspace/3.2/DciApiTest
> init path 2 exists 0
>
> The / after the : gets lost and therefore the file isn't found.
>
> Thanks in advance!
>
> BTW: Using MinGW.
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