Boost logo

Boost Users :

From: Richard Dingwall (rdingwall_at_[hidden])
Date: 2007-02-01 14:49:08


On 2/2/07, Polder, Matthew J <matthew.j.polder_at_[hidden]> wrote:
>
>
>
> Hi,
>
> I started using filesystem, regex, and bind today. It's been interesting.
>
> I'm using Visual C++ 8.0 on an XP machine that has network filesystems
> mounted to it, some using letters (H:\, Y:\, etc.), some accessable via two
> slashes (//linden/temp/, etc). I'd like to peruse these using
> boost::filesystem.
>
> The following works:
>
>
> std::string t = "h:\\temp";
> boost::filesystem::path p(t, boost::filesystem::native);
>
> but I can't get filesystem to work with the string "h:/temp";
>
> std::string s = p.string(); // s = "h:/temp"

h:/temp doesn't work in windows explorer either. You're mixing windows
drive letters with POSIX path separators!

Try h:\temp instead.

>
> bool b = boost::filesystem::portable_posix_name(s);
> //returns false
> b = boost::filesystem::windows_name(s); //returns false
> b = boost::filesystem::portable_name(s); //returns false
> b = boost::filesystem::portable_directory_name(s);
> //returns false
> b = boost::filesystem::portbale_file_name(s); //returns
> false
> b = boost::filesystem::native(s); //returns false
>
> Also, I'd like to do the following
>
> std::string q = "//linden/temp/";
> boost::filesystem::path p2(q);

Again, your slashes are backwards, use \\linden\temp\.
>
> Any help is appreciated.
>
> thanks,
> matthew
>
>
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users
>
>


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