| Crates.io | gamedirs |
| lib.rs | gamedirs |
| version | 0.0.1 |
| created_at | 2025-09-17 10:05:36.329176+00 |
| updated_at | 2025-09-17 10:05:36.329176+00 |
| description | Opinionated base directory helpers for Windows, Linux, and macOS (settings, saves, logs, temp). Mainly for games. |
| homepage | |
| repository | |
| max_upload_size | |
| id | 1843046 |
| size | 9,846 |
Opinionated storage basedirs for applications, mainly for games.
Settings should be local and bound to the device.
%LOCALAPPDATA%\<company>\<app>\Config\
~/Library/Application Support/<bundle-id>/
$XDG_CONFIG_HOME/<company>/<app>/ falls back to ~/.config/<company>/<app>/
These are things that should sync to the cloud, and be available to the user's devices.
%USERPROFILE%\Saved Games\<company>\<app>\ (use SHGetKnownFolderPath(FOLDERID_SavedGames)?)
~/Library/Application Support/<bundle-id> (some use Company/Game).
$XDG_DATA_HOME/<company>/<app>/ (fallback ~/.local/share/<company>/<app>/)
(basedir-spec) [https://specifications.freedesktop.org/basedir-spec/latest/]
Things that are inherently tied to a device, should not be synced.
%LOCALAPPDATA%\<company>\<game>\logs\ (local, non-roaming, the logs can be quite large).
~/Library/Logs/<bundle-id>/ (user logs)
Use $XDG_STATE_HOME (default ~/.local/state), e.g.:
$XDG_STATE_HOME/<company>/<app>/logs/ → fallback ~/.local/state/<company>/<app>/logs/.
Should not be available after reboot. For temporary files that are discarded or moved to a permanent location.
GetTempPath (respects %TEMP%, %TMP%, etc.)
Use FileManager.temporaryDirectory or NSTemporaryDirectory() for per-user temp space.
Use $TMPDIR if set, otherwise /tmp
bundle_id: com.companyname.appname
Copyright (c) Peter Bjorklund. All rights reserved.