On 3/17/07, Tom Bachmann
Is the following code expected to be portable?
namespace fs = boost::filesystem; fs::rename (current_p, skin_p / current_p.leaf ());
Only if the paths pass the name checker, as you've found out.
boost::filesystem::path: invalid name "10NfRaHD1AAICPMKZIC50FvmaHw==.medium.jpg" in path: "10NfRaHD1AAICPMKZIC50FvmaHw==.medium.jpg"
(that is, I believe, at the point where a temporary path object is constructed from current_p.leaf ()). This appears quiet strange to me, as I never mention the file in the code, and I'd expect the library to treat such oddities.
The library does not track the source of paths.
The following code works:
fs::rename (current_p, skin_p / fs::path (current_p.leaf (), fs::native));
Is this the expected behavior?
Yes. Note that in 1.34, the obligatory path checking has been removed, so the original code will work as expected. In the mean time, you may wish to set the default path checker to native (or none). ~ Scott McMurray