-
-
Notifications
You must be signed in to change notification settings - Fork 32
Open
Description
Description
The XDG_RUNTIME_DIR mapping in adrg/xdg does not align with established practices from other cross-platform libraries like platformdirs (Python) and dirs (Rust).
Currently, adrg/xdg sets:
- macOS →
~/Library/Application Support/ - Windows →
%LOCALAPPDATA%
However, there are two common approaches used in other libraries:
| OS | platformdirs (Python) |
dirs (Rust) |
adrg/xdg (Current) |
|---|---|---|---|
| Linux | /run/user/$UID |
/run/user/$UID |
✅ /run/user/$UID |
| macOS | ~/Library/Caches/TemporaryItems |
None |
❌ ~/Library/Application Support |
| Windows | %TEMP% |
None |
❌ %LOCALAPPDATA% |
Two Common Approaches
platformdirs(Python): Fallbacks to a cache or temporary directory.dirs(Rust): ReturnsNonesinceXDG_RUNTIME_DIRis not officially defined for macOS and Windows.
As stated by dirs:
It is required that this directory is created when the user logs in, is only accessible by the user itself, is deleted when the user logs out, and supports all filesystem features of the operating system.
Possible Fixes
- Follow
platformdirs: Use- macOS →
~/Library/Caches/TemporaryItems - Windows →
%TEMP%
- macOS →
- Follow
dirs: Returnnilfor macOS/Windows.
Either would be better than the current behavior.
Metadata
Metadata
Assignees
Labels
No labels