Find directory for “application data” on linux and macintosh

后端 未结 2 1498
一向
一向 2020-12-15 22:35

I have a game engine based on LWJGL, and to run it I need to place the required native libraries onto the user\'s computer. On Windows, I do so by finding the Application Da

相关标签:
2条回答
  • 2020-12-15 23:11

    this should work. just one thing: on linux it is preferred to keep settings in a hidden folder in user directory. So for linux, either put your folder under $HOME/.config, or start the name with the . to make it hidden.

    0 讨论(0)
  • 2020-12-15 23:12

    As already stated on Linux you should/could put your data in a .directory in the home.

    I have however a tip for you: "APPDATA" unfortunately doesn't always find the correct directory across several WindowsVersions. AFAIK the only know way i know how to do this correctly is calling a msdn-function called SHGetFolderPath.

    Sample: http://github.com/fab1an/appkit/blob/master/src/main/java/org/appkit/osdependant/OSFolders.java

    0 讨论(0)
提交回复
热议问题