Is there a cross-platform special directory I can use for game save files?

Posted by Suds on Game Development See other posts from Game Development or by Suds
Published on 2012-01-28T04:20:03Z Indexed on 2012/09/08 3:49 UTC
Read the original article Hit count: 232

Filed under:
|
|
|

I'm developing with LWJGL and Java on a Windows 7 laptop. I've successfully set up saving to the %appdata%\gamename\saves\ or long form c:\users\user\appdata\roaming\gamename\saves\ folder by using File dir = new File(System.getenv("APPDATA") + "\\gamename\\saves\\");.

I have hobbyist level experience with Linux, and zero experience with OSX. My game will be fully cross platform.

Is System.getenv("APPDATA"); cross platform? If so, where does it point to on Linux or OSX? Is there a best practices alternative that I should use?

© Game Development or respective owner

Related posts about java

Related posts about lwjgl