|
Boost Users : |
From: Maarten Nieber (hallomaarten_at_[hidden])
Date: 2006-08-07 03:04:00
> 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)" <telya_at_[hidden]> wrote:
> > 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_at_[hidden]
>
>
>
> > -----Original Message-----
> > From: boost-users-bounces_at_[hidden]
> > [mailto:boost-users-bounces_at_[hidden]] On
> Behalf Of
> > Maarten Nieber
> > Sent: Friday, August 04, 2006 3:07 PM
> > To: Boost-users_at_[hidden]
> > 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_at_[hidden]
> >
>
http://lists.boost.org/mailman/listinfo.cgi/boost-users
> >
>
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
>
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
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