Boost logo

Boost Users :

From: Küppers, Ben (ben.kuppers_at_[hidden])
Date: 2006-11-02 04:36:31


Greetings,

I posted this topic on the boost mailing list but believe this is a better place to discuss it. I am trying to write some cross-platform code that processes a Windows provided file path. The file path is of the form .\filename.ext (i.e. Windows style relative to current directory).

Using the construct

boost::filesystem::path path( ".\\filename.ext", boost::filesystem::native )

I have been able to successfully parse this path on Windows. However, I can't seem to find a construct that yields similar results on Linux. I have tried using default and explicit name checkers which result in either a filesystem_error exception or the obscurely named hidden file .\filename.ext.

The library contains the logic to do this right otherwise the Windows version wouldn't work either. However, it seems the necessary code is excluded from compilation for systems other than Windows. I am trying to understand why this decision is made at compile time and is not accessible at runtime.

Ideally, I would like to be able to tell the path class to use Windows path parsing (regardless of the platform the app is running on). Something in the style of:

boost::filesystem::path path( ".\\filename.ext", boost::filesystem::windows )

There is a windows_name checker but it doesn't support the ".". Neither would the library be able to parse the path because of the compile-time exclusion mentioned above. At the moment, I don't see any other option than to process the path string manually before passing it to the path constructor (kind-a defeats the whole purpose of using this class).
 
Anybody have any ideas? Also, am I really trying to do something that exotic or is this library missing some essential functionality?
 
Ben

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-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