Where should I save files in MacOS if I want them ...
# compose-desktop
s
Where should I save files in MacOS if I want them to be available after an upgrade?
c
A common pattern of a lot of desktop or CLI apps is to store them in a hidden folder in the user’s home directory (for example
~/.myAppName/settings.json
)
s
I thought there was an official place for them to be stored
e
on macos,
~/Library/Application Support/(your name)
s
This is what I was looking for. Thank you.
Any chance you know how to get this from Java?
e
you mean from Kotlin? probably something like
Copy code
NSFileManager.defaultManager.URLForDirectory(directory = NSApplicationSupportDirectory, domain = NSUserDomainMask, url = null, shouldCreate = true, error = null)
in K/N but I don't have a mac so can't confirm
s
yeah - I wouldn’t have trouble getting it in Kotlin Native
e
well, looks like there used to be bridges in eAWT with the Apple JVMs, but those are dead, so you'll have to do your own JNI if you want this from Kotlin/JVM