just like a . folder under the home dir?
# compose-desktop
c
just like a . folder under the home dir?
d
I'd also be interested in best practices around this. I'm not aware of a standard, like you suggest @Cody Mikol I think it's reasonable to use e.g.
System.getProperty("user.dir")
to identify user folder in a cross-platform manner, then manage a sub-folder of your own.
I've seen some go to the lengths of identifying e.g.
AppData
folder from there, on MacOS systems, but I'd be concerned about robustness with later MacOS versions in that case - Apple are prone to change the world at times.
c
Thanks 🙂
the most futureproof is my preferred solution
e
There are standards for each platform. I typically check for the XDG-defined environment variables (https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html) first, regardless of the platform. Then, Windows and macOS each have their own conventions for locating these types of directories: • Windows: https://docs.microsoft.com/en-us/windows/win32/shell/known-folders ◦ Windows has environment variables you can check as well; for application state you'd probably want a subdirectory in
%APPDATA%
or
%LOCALAPPDATA%
• macOS: https://developer.apple.com/library/archive/documentation/FileManagement/Conceptual/Fi[…]ProgrammingGuide/FileSystemOverview/FileSystemOverview.html
👀 1
m
You might just use a library which can provide you with this information. https://github.com/harawata/appdirs
👍 1
☝️ 1
b
For unix, most of app state should go to ~/.config
☝🏻 1
☝️ 1
m