In Linux , for example, this folder will be /home/user_name/.app_name , and in Windows , the folder is AppData .
How to get the path to the directory in which you can create the folder .app_name and store the application files?
In Linux , for example, this folder will be /home/user_name/.app_name , and in Windows , the folder is AppData .
How to get the path to the directory in which you can create the folder .app_name and store the application files?
If you want to cross-platform - you need to look in the direction of cross-platform libraries, for example Qt . There it will be something like QStandardPaths::AppDataLocation .
At the language level, there are no folders with application files. Even after adding filesystem to the standard library, you will have to rely on some OS settings.
Such a class is - QStandardPaths . There are examples of real ways - choose what you need. Yes, for this you have to move to Qt :)
QStandardPaths have source codes? And then move is not a hunt. - pank#ifdef set of #ifdef 's. - VladDOffhand 2 options:
getenv("HOME")System.getProperty("user.home");Source: https://ru.stackoverflow.com/questions/618831/
All Articles