An unopinionated Rust library for locating configuration, data and cache directories across platforms
Rust
151
89 commits
updated Aug 4, 2026
This is a Rust library that allows you to determine the locations of configuration, data, cache & other files for your application. Existing Rust libraries generally do not give you a choice in terms of which standards/conventions they follow. Etcetera, on the other hand, gives you the choice.
MSRV: 1.95.0
Note: The MSRV was raised to 1.95.0 in v0.12 to remove the dependency on the cfg-if crate & instead use the cfg_select! macro introduced in that version.
If you want, you can use one of the following releases with a lower MSRV:
Etcetera supports the following conventions:
~/.myappEtcetera has 2 modes of operation: BaseStrategy & AppStrategy:
BaseStrategy, you just get the location of the respective directory. For eg. for config_dir():
~/.config~/Library/Preferences~\AppData\RoamingAppStrategy, you provide additional information to get the location of your app directory.
For eg. if you provide the following details: { top_level_domain: "org", author: "Acme Corp", app_name: "Frobnicator Plus" }, you'll get:
~/.config/frobnicator-plus~/.frobnicator-plus~/Library/Preferences/org.acme-corp.Frobnicator-Plus~\AppData\Roaming\Acme Corp\Frobnicator PlusNote: the location of the home (~) is determined by std::env::home_dir.
Etcetera also provides convenience functions for selecting the appropriate strategy on each platform:
base_strategy::choose_base_strategy & app_strategy::choose_app_strategy: Uses Windows on Windows & XDG everywhere else.
This is used by most CLI tools & some GUI tools on each platform.base_strategy::choose_native_strategy & app_strategy::choose_native_strategy: Uses Windows on Windows, Apple on macOS/iOS, & XDG everywhere else.
This is used by most GUI applications on each platform.See the documentation for examples.
363 followers · starred Mar 2025
120 followers · starred Jul 2026
107 followers · starred Apr 2025
228 followers · starred May 2025
An unopinionated Rust library for locating configuration, data and cache directories across platforms
Rust
151
89 commits
updated Aug 4, 2026
This is a Rust library that allows you to determine the locations of configuration, data, cache & other files for your application. Existing Rust libraries generally do not give you a choice in terms of which standards/conventions they follow. Etcetera, on the other hand, gives you the choice.
MSRV: 1.95.0
Note: The MSRV was raised to 1.95.0 in v0.12 to remove the dependency on the cfg-if crate & instead use the cfg_select! macro introduced in that version.
If you want, you can use one of the following releases with a lower MSRV:
Etcetera supports the following conventions:
~/.myappEtcetera has 2 modes of operation: BaseStrategy & AppStrategy:
BaseStrategy, you just get the location of the respective directory. For eg. for config_dir():
~/.config~/Library/Preferences~\AppData\RoamingAppStrategy, you provide additional information to get the location of your app directory.
For eg. if you provide the following details: { top_level_domain: "org", author: "Acme Corp", app_name: "Frobnicator Plus" }, you'll get:
~/.config/frobnicator-plus~/.frobnicator-plus~/Library/Preferences/org.acme-corp.Frobnicator-Plus~\AppData\Roaming\Acme Corp\Frobnicator PlusNote: the location of the home (~) is determined by std::env::home_dir.
Etcetera also provides convenience functions for selecting the appropriate strategy on each platform:
base_strategy::choose_base_strategy & app_strategy::choose_app_strategy: Uses Windows on Windows & XDG everywhere else.
This is used by most CLI tools & some GUI tools on each platform.base_strategy::choose_native_strategy & app_strategy::choose_native_strategy: Uses Windows on Windows, Apple on macOS/iOS, & XDG everywhere else.
This is used by most GUI applications on each platform.See the documentation for examples.
363 followers · starred Mar 2025
120 followers · starred Jul 2026
107 followers · starred Apr 2025
228 followers · starred May 2025