Re: [Boost-users] [filesystem] unable to parse file path
-----Original Message----- From: boost-users-bounces@lists.boost.org [mailto:boost-users- bounces@lists.boost.org] On Behalf Of Küppers, Ben Sent: Friday, November 03, 2006 1:56 AM To: boost-users@lists.boost.org 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.
participants (1)
-
Nat Goodspeed