#path #xdg #folders #dirs #directories #operating-system

pathos

A natural API for handling OS-specific user or system directories, including iOS and Android

22 releases

0.3.0 Jul 8, 2022
0.3.0-pre.5 Mar 21, 2022
0.3.0-pre.4 Jun 20, 2021
0.3.0-pre.3 Mar 6, 2021
0.1.7 Jul 9, 2020

#296 in Operating systems

Download history 3372/week @ 2023-12-13 3164/week @ 2023-12-20 3023/week @ 2023-12-27 3451/week @ 2024-01-03 3220/week @ 2024-01-10 4325/week @ 2024-01-17 3922/week @ 2024-01-24 3922/week @ 2024-01-31 4774/week @ 2024-02-07 4155/week @ 2024-02-14 4457/week @ 2024-02-21 5475/week @ 2024-02-28 5066/week @ 2024-03-06 4258/week @ 2024-03-13 5590/week @ 2024-03-20 4030/week @ 2024-03-27

19,899 downloads per month
Used in 6 crates (4 directly)

Apache-2.0 OR MIT

55KB
1.5K SLoC

pathos

Documentation Actions Status

noun From Ancient Greek πάθος (páthos, “suffering”). The quality or property of anything which touches the feelings or excites emotions and passions, especially that which awakens tender emotions, such as pity, sorrow, and the like; contagious warmth of feeling, action, or expression; pathetic quality.

A natural API for finding OS-specific user or system directories, regardless of the operating system.

pathos specifically supports iOS and Android's idiosyncratic handling of 'user' directories.

Features

URL path handling

pathos supports Unicode-safe URL paths for file:, and a special custom container: scheme on iOS and Android. pathos can convert between ordinary Path types and these Iri types with ease, simplifying saving paths in a configuration system without worrying about OsString problems.

Platform-agnostic modules

Don't care what platform you're building for and just want a project directory in the right place? pathos::system and pathos::user re-export the host platform's submodule.

Platform-specific handling

Sometimes you have to care what platform you're on for special-cased weirdness. In those cases, the appropriate APIs are available on the relevant OS submodule.

Full XDG support

XDG is the default mechanism for handling user directories on Linux, and can be opted into on other platforms by using the pathos::xdg module.

Usage

Add the following to your Cargo.toml:

pathos = "0.2"

Where is this used?

  • box - a modern replacement for the zip file format
  • pahkat - a cross-platform package management system

License

Licensed under either of

at your option.

Dependencies

~0.8–1.7MB
~35K SLoC