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.
精彩评论