Boost logo

Boost :

From: Küppers, Ben (ben.kuppers_at_[hidden])
Date: 2006-10-30 10:31:20


How do I use boost::filesystem::path to parse a Windows file path in a Linux environment?

 

On Windows boost::filesystem::path path( ".\\main.cpp", boost::filesystem::native ) yields main.cpp.

 

On Linux this yields the obscurely named hidden file .\main.cpp.

 

However, there doesn't seem to be a name_checker that yields the same result as the Windows implementation. Running for_each on the path string to replace all the back slashes with forward slashes before calling the path constructor seems to (at least partly) defeat the purpose of using the library.

 

Note that the file path (.\\main.cpp in example) is a provided by an external (Windows) application and I don't have a way of changing this input.

 

Thanks in advance,

 

Ben Kuppers

This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk