Boost logo

Boost Users :

From: Markus Svilans (msvilans_at_[hidden])
Date: 2008-04-24 15:49:07


Hi Robert,

I have used Boost paths on Windows like this:

    namespace bf = boost::filesystem;
    bf::path temp("C:\\Windows\\System32\\", bf::native);

Adding the "native" parameter tells the path object it is parsing a
Windows path (if compiling on Windows).

To my knowledge, the path object will always store paths in its own
internal format, which uses front slashes as directory separators. More
info on this is in the boost::filesystem documentation.

The basic_path::file_string() method returns the path in the operating
system native format, if I'm not mistaken.

Regards,
Markus.

Robert Dailey wrote:
> Hi,
>
> I create the following object:
>
> boost::filesystem::path mypath( "SomeFolder/OnWindows/SubFolder" );
>
> In Microsoft Windows, the standard slash direction is "\", so when I
> run the above in the debugger, I notice m_path is still using forward
> slashes ("/"). I would have expected the slashes to be normalized. Am
> I misunderstanding something? How can I construct a path object like
> above and have it normalize the slashes? Thanks.
> ------------------------------------------------------------------------
>
> _______________________________________________
> 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