Handling file paths cross platform
Do any C++ GNU standalone classes exist which handle paths cross platform? My applications build on Windows and LInux. Our configuration files refer to another file in a seperate directory. I'd like to be able to read the path for the other configuration file into a class which would work on both Linux or Windows.
Which class would offer the smallest footprint to translate paths to use on either system? Thanks
Unless you're using absolute paths, there's no need to translate at all - Windows automatically converts forward slashes into backslashes, so if you use relative paths with forward slash path separators, you'll be golden. You should really avoid absolute paths if at all possible.
尝试boost :: filesystem
boost中的文件系统库可能会帮助你。
链接地址: http://www.djcxy.com/p/9242.html上一篇: 我如何获得平台
下一篇: 处理文件路径跨平台