开发者

Cross-platform C++ Directory Managing

开发者 https://www.devze.com 2023-02-17 20:00 出处:网络
Are there any cross p开发者_开发百科latform libraries that will help me place certain file in different directories. For example in windows a config file will probably go in app data, yet in Linux it

Are there any cross p开发者_开发百科latform libraries that will help me place certain file in different directories. For example in windows a config file will probably go in app data, yet in Linux it will go in /etc/ or /use/etc/ depending on where it was installed. Is there any way to do this transparently?


boost::filesystem will should soon provide such functionalities (but not yet). I would be you, I'd use boost::filesystem and provide different addresses of user folders by platforms, then when boost::filesystem provide the feature, replace the implementations.


Did you try with Qt libraries?

Both QFileInfo( qApp->argv()[0] )::absFilePath () and QApplication::applicationDirPath() can work.

0

精彩评论

暂无评论...
验证码 换一张
取 消