Resolve native per-user application configuration directories

This commit is contained in:
2026-11-08 12:48:30 +01:00
parent 7893922df2
commit 23ad65062f
4 changed files with 80 additions and 1 deletions
+11
View File
@@ -0,0 +1,11 @@
# Native application configuration directories
`ApplicationDirectories.configurationDirectory(application)` resolves a per-user configuration directory without creating files. The application must be a single nonempty directory name, with no separators or traversal components.
- macOS: `~/Library/Application Support/<application>`.
- Windows: `%APPDATA%/<application>`, falling back to `~/AppData/Roaming/<application>` when the environment override is absent or relative.
- Linux: `$XDG_CONFIG_HOME/<application>` when absolute, otherwise `~/.config/<application>`.
The overload accepting an operating-system name, home directory, and environment map supports isolated launchers and deterministic checks. Resolution never reads or writes an application's preferences. The consuming application owns its schema, persistence, validation, and UI.
Tests cover macOS Application Support, Windows roaming paths, Linux XDG overrides/fallback, and invalid application names. Simulated platform inputs do not establish native packaged-application acceptance on those platforms.