
boost::filesystem::path("c:\\test.txt", boost::filesystem::native);
Alas, this does not work. The colon (:) is not
accepted
by the name_check function. I tried to fix it by using
my own name check, and by replacing the backslash with
slash (although I would be surprised if these tricks
would be necessary)
path::name_check newNameCheck = &my_windows_name;
boost::filesystem::path testPath("c:/test.txt",
newNameCheck);
std::cout << testPath.native_file_string();
In this case, the path constructor accepts its
argument, but native_file_string() returns
c:test.txt
instead of c:/test.txt.
--- "Andriy Tylychko (mail.ru)"
For instance, if the path should point to c:\test.txt (on a Windows system), what is the portable filename that I should pass to the boost::filesystem::path constructor?
boost::filesystem::path("c:\\test.txt", boost::filesystem::native);
Best regards, Andriy Tylychko, telya@mail.ru
-----Original Message----- From: boost-users-bounces@lists.boost.org [mailto:boost-users-bounces@lists.boost.org] On Behalf Of Maarten Nieber Sent: Friday, August 04, 2006 3:07 PM To: Boost-users@lists.boost.org Subject: [Boost-users] [Filesystem] Drive letter in argument forboost::filesystem::path
Dear boost users,
can anybody explain how to pass a filename containing a (windows) drive letter into a boost::filesystem::path?
For instance, if the path should point to c:\test.txt (on a Windows system), what is the portable filename that I should pass to the boost::filesystem::path constructor?
Thanks in advance! Maarten
__________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org
http://lists.boost.org/mailman/listinfo.cgi/boost-users
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org
http://lists.boost.org/mailman/listinfo.cgi/boost-users
__________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com