Boost logo

Boost Users :

From: Nat Goodspeed (ngoodspeed_at_[hidden])
Date: 2006-11-03 07:22:20


> -----Original Message-----
> From: boost-users-bounces_at_[hidden] [mailto:boost-users-
> bounces_at_[hidden]] On Behalf Of Küppers, Ben
> Sent: Friday, November 03, 2006 1:56 AM
> To: boost-users_at_[hidden]
> Subject: RE: [Boost-users] [filesystem] unable to parse file path
>
> > [Nat] I'd suggest a string pass -- on every platform -- to change every
> > '\' to '/' before passing it to boost::filesystem::path. I believe
> > forward slash should work everywhere. I find it plausible that backslash
> > would only work on Windows.
>
> That is what I am doing right now but I started using
> boost::filesystem::path to get out of that business.

[Nat] I guess I have a couple of comments.

One is that a character substitution pass is still cheaper than the directory parsing and other goodies that boost::filesystem gets you.

The other is to ask why your *nix requirements include backslashes as directory separators? Backslashes have other significance everywhere but Windows, which is presumably why boost::filesystem::path wasn't written to treat '\' and '/' interchangeably on all platforms. Backslashes (and forward slashes) work on Windows, forward slashes work elsewhere, all per convention.

You seem disappointed that boost::filesystem::path doesn't treat backslashes as directory separators on non-Windows systems.


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