2

We have a Windows Java desktop application that creates some configuration files at %APPDATA% and creates logs at %TEMP% location. Now we are planning to release that desktop application for Mac OS X. We are facing following difficulties:

  1. We do not want to keep application data within .app (file extension app) so please suggest where else we can keep our configuration files.
  2. We do not want to keep temporary files at %TEMP% location in Mac OS X because Mac OS X automatically cleans the %TEMP% location as per schedule.

So we do not want data lose from temp and do not want to keep data with in .app. Please suggest.

Thanks

Joachim Sauer
  • 302,674
  • 57
  • 556
  • 614
Ashish Pancholi
  • 4,569
  • 13
  • 50
  • 88
  • 4
    Uhm ... if you don't want to lose some files then any kind of temp directory is not the correct place. The whole point of those directories is that any data in there is replaceable (this is also true for Windows!) – Joachim Sauer Mar 14 '11 at 11:54

3 Answers3

5

You should probably put the files under /Library/Application Support/<your app> or ~/Library/Application Support/<your app>

If the resources apply to all users on the system, such as document templates, place them in /Library/Application Support. If the resources are user-specific, such as workspace configuration files, place them in the current user’s ~/Library/Application Support directory.

Source: Determining Where to Store Your App-Specific Files

mike663
  • 623
  • 5
  • 12
Sean Patrick Floyd
  • 292,901
  • 67
  • 465
  • 588
2

We do not want to keep application data within .app (file extension app) so please suggest where else we can keep our configuration files.

Use Preference API

We do not want to keep temporary files at %TEMP% location in MAC OS because MAC OS automatically clean %TEMP% location as per schedule.

Create a dir under user.home to keep temp data

jmj
  • 237,923
  • 42
  • 401
  • 438
0

Either ~/Library/Application Support or ~/Library/Caches come to mind. Use the APIs if possible.

svoop
  • 3,318
  • 1
  • 23
  • 41