[
  {
    "path": ".github/workflows/rust.yml",
    "content": "name: Rust\n\non:\n  push:\n    branches: [ \"main\" ]\n  pull_request:\n    branches: [ \"main\" ]\n\nenv:\n  CARGO_TERM_COLOR: always\n  CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse\n  RUST_BACKTRACE: full\n\njobs:\n  build-and-test:\n    runs-on: ${{ matrix.os }}\n\n    strategy:\n      matrix:\n        os: [ubuntu-latest, windows-latest, macos-latest]\n\n    steps:\n      - uses: actions/checkout@v3\n      - name: Build\n        run: cargo build --verbose\n      - name: Test\n        run: cargo test --verbose -- --nocapture\n"
  },
  {
    "path": ".gitignore",
    "content": "Cargo.lock\n/target\n**/*.rs.bk\n.idea\n"
  },
  {
    "path": "Cargo.toml",
    "content": "[package]\nname        = \"dirs\"\nversion     = \"6.0.0\"\nauthors     = [\"Simon Ochsenreither <simon@ochsenreither.de>\"]\ndescription = \"A tiny low-level library that provides platform-specific standard locations of directories for config, cache and other data on Linux, Windows, macOS and Redox by leveraging the mechanisms defined by the XDG base/user directory specifications on Linux, the Known Folder API on Windows, and the Standard Directory guidelines on macOS.\"\nreadme      = \"README.md\"\nlicense     = \"MIT OR Apache-2.0\"\nrepository  = \"https://github.com/soc/dirs-rs\"\nmaintenance = { status = \"actively-developed\" }\nkeywords    = [\"xdg\", \"basedir\", \"app_dirs\", \"path\", \"folder\"]\n\n[dependencies]\ndirs-sys = \"0.5.0\"\n"
  },
  {
    "path": "LICENSE-APACHE",
    "content": "                              Apache License\n                        Version 2.0, January 2004\n                     http://www.apache.org/licenses/\n\nTERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n1. Definitions.\n\n   \"License\" shall mean the terms and conditions for use, reproduction,\n   and distribution as defined by Sections 1 through 9 of this document.\n\n   \"Licensor\" shall mean the copyright owner or entity authorized by\n   the copyright owner that is granting the License.\n\n   \"Legal Entity\" shall mean the union of the acting entity and all\n   other entities that control, are controlled by, or are under common\n   control with that entity. For the purposes of this definition,\n   \"control\" means (i) the power, direct or indirect, to cause the\n   direction or management of such entity, whether by contract or\n   otherwise, or (ii) ownership of fifty percent (50%) or more of the\n   outstanding shares, or (iii) beneficial ownership of such entity.\n\n   \"You\" (or \"Your\") shall mean an individual or Legal Entity\n   exercising permissions granted by this License.\n\n   \"Source\" form shall mean the preferred form for making modifications,\n   including but not limited to software source code, documentation\n   source, and configuration files.\n\n   \"Object\" form shall mean any form resulting from mechanical\n   transformation or translation of a Source form, including but\n   not limited to compiled object code, generated documentation,\n   and conversions to other media types.\n\n   \"Work\" shall mean the work of authorship, whether in Source or\n   Object form, made available under the License, as indicated by a\n   copyright notice that is included in or attached to the work\n   (an example is provided in the Appendix below).\n\n   \"Derivative Works\" shall mean any work, whether in Source or Object\n   form, that is based on (or derived from) the Work and for which the\n   editorial revisions, annotations, elaborations, or other modifications\n   represent, as a whole, an original work of authorship. For the purposes\n   of this License, Derivative Works shall not include works that remain\n   separable from, or merely link (or bind by name) to the interfaces of,\n   the Work and Derivative Works thereof.\n\n   \"Contribution\" shall mean any work of authorship, including\n   the original version of the Work and any modifications or additions\n   to that Work or Derivative Works thereof, that is intentionally\n   submitted to Licensor for inclusion in the Work by the copyright owner\n   or by an individual or Legal Entity authorized to submit on behalf of\n   the copyright owner. For the purposes of this definition, \"submitted\"\n   means any form of electronic, verbal, or written communication sent\n   to the Licensor or its representatives, including but not limited to\n   communication on electronic mailing lists, source code control systems,\n   and issue tracking systems that are managed by, or on behalf of, the\n   Licensor for the purpose of discussing and improving the Work, but\n   excluding communication that is conspicuously marked or otherwise\n   designated in writing by the copyright owner as \"Not a Contribution.\"\n\n   \"Contributor\" shall mean Licensor and any individual or Legal Entity\n   on behalf of whom a Contribution has been received by Licensor and\n   subsequently incorporated within the Work.\n\n2. Grant of Copyright License. Subject to the terms and conditions of\n   this License, each Contributor hereby grants to You a perpetual,\n   worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n   copyright license to reproduce, prepare Derivative Works of,\n   publicly display, publicly perform, sublicense, and distribute the\n   Work and such Derivative Works in Source or Object form.\n\n3. Grant of Patent License. Subject to the terms and conditions of\n   this License, each Contributor hereby grants to You a perpetual,\n   worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n   (except as stated in this section) patent license to make, have made,\n   use, offer to sell, sell, import, and otherwise transfer the Work,\n   where such license applies only to those patent claims licensable\n   by such Contributor that are necessarily infringed by their\n   Contribution(s) alone or by combination of their Contribution(s)\n   with the Work to which such Contribution(s) was submitted. If You\n   institute patent litigation against any entity (including a\n   cross-claim or counterclaim in a lawsuit) alleging that the Work\n   or a Contribution incorporated within the Work constitutes direct\n   or contributory patent infringement, then any patent licenses\n   granted to You under this License for that Work shall terminate\n   as of the date such litigation is filed.\n\n4. Redistribution. You may reproduce and distribute copies of the\n   Work or Derivative Works thereof in any medium, with or without\n   modifications, and in Source or Object form, provided that You\n   meet the following conditions:\n\n   (a) You must give any other recipients of the Work or\n       Derivative Works a copy of this License; and\n\n   (b) You must cause any modified files to carry prominent notices\n       stating that You changed the files; and\n\n   (c) You must retain, in the Source form of any Derivative Works\n       that You distribute, all copyright, patent, trademark, and\n       attribution notices from the Source form of the Work,\n       excluding those notices that do not pertain to any part of\n       the Derivative Works; and\n\n   (d) If the Work includes a \"NOTICE\" text file as part of its\n       distribution, then any Derivative Works that You distribute must\n       include a readable copy of the attribution notices contained\n       within such NOTICE file, excluding those notices that do not\n       pertain to any part of the Derivative Works, in at least one\n       of the following places: within a NOTICE text file distributed\n       as part of the Derivative Works; within the Source form or\n       documentation, if provided along with the Derivative Works; or,\n       within a display generated by the Derivative Works, if and\n       wherever such third-party notices normally appear. The contents\n       of the NOTICE file are for informational purposes only and\n       do not modify the License. You may add Your own attribution\n       notices within Derivative Works that You distribute, alongside\n       or as an addendum to the NOTICE text from the Work, provided\n       that such additional attribution notices cannot be construed\n       as modifying the License.\n\n   You may add Your own copyright statement to Your modifications and\n   may provide additional or different license terms and conditions\n   for use, reproduction, or distribution of Your modifications, or\n   for any such Derivative Works as a whole, provided Your use,\n   reproduction, and distribution of the Work otherwise complies with\n   the conditions stated in this License.\n\n5. Submission of Contributions. Unless You explicitly state otherwise,\n   any Contribution intentionally submitted for inclusion in the Work\n   by You to the Licensor shall be under the terms and conditions of\n   this License, without any additional terms or conditions.\n   Notwithstanding the above, nothing herein shall supersede or modify\n   the terms of any separate license agreement you may have executed\n   with Licensor regarding such Contributions.\n\n6. Trademarks. This License does not grant permission to use the trade\n   names, trademarks, service marks, or product names of the Licensor,\n   except as required for reasonable and customary use in describing the\n   origin of the Work and reproducing the content of the NOTICE file.\n\n7. Disclaimer of Warranty. Unless required by applicable law or\n   agreed to in writing, Licensor provides the Work (and each\n   Contributor provides its Contributions) on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n   implied, including, without limitation, any warranties or conditions\n   of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n   PARTICULAR PURPOSE. You are solely responsible for determining the\n   appropriateness of using or redistributing the Work and assume any\n   risks associated with Your exercise of permissions under this License.\n\n8. Limitation of Liability. In no event and under no legal theory,\n   whether in tort (including negligence), contract, or otherwise,\n   unless required by applicable law (such as deliberate and grossly\n   negligent acts) or agreed to in writing, shall any Contributor be\n   liable to You for damages, including any direct, indirect, special,\n   incidental, or consequential damages of any character arising as a\n   result of this License or out of the use or inability to use the\n   Work (including but not limited to damages for loss of goodwill,\n   work stoppage, computer failure or malfunction, or any and all\n   other commercial damages or losses), even if such Contributor\n   has been advised of the possibility of such damages.\n\n9. Accepting Warranty or Additional Liability. While redistributing\n   the Work or Derivative Works thereof, You may choose to offer,\n   and charge a fee for, acceptance of support, warranty, indemnity,\n   or other liability obligations and/or rights consistent with this\n   License. However, in accepting such obligations, You may act only\n   on Your own behalf and on Your sole responsibility, not on behalf\n   of any other Contributor, and only if You agree to indemnify,\n   defend, and hold each Contributor harmless for any liability\n   incurred by, or claims asserted against, such Contributor by reason\n   of your accepting any such warranty or additional liability.\n"
  },
  {
    "path": "LICENSE-MIT",
    "content": "Copyright (c) 2018-2019 dirs-rs contributors\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"
  },
  {
    "path": "README.md",
    "content": "[![crates.io](https://img.shields.io/crates/v/dirs.svg?style=for-the-badge)](https://crates.io/crates/dirs)\n[![API documentation](https://img.shields.io/docsrs/dirs/latest?style=for-the-badge)](https://docs.rs/dirs/)\n![actively developed](https://img.shields.io/badge/maintenance-actively--developed-brightgreen.svg?style=for-the-badge)\n![License: MIT/Apache-2.0](https://img.shields.io/badge/license-MIT%2FApache--2.0-orange.svg?style=for-the-badge)\n\n# `dirs`\n\n## Introduction\n\n- a tiny low-level library with a minimal API\n- that provides the platform-specific, user-accessible locations\n- for retrieving and storing configuration, cache and other data\n- on Linux, Redox, Windows (≥ Vista), macOS and other platforms.\n\nThe library provides the location of these directories by leveraging the mechanisms defined by\n- the [XDG base directory](https://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html) and\n  the [XDG user directory](https://www.freedesktop.org/wiki/Software/xdg-user-dirs/) specifications on Linux and Redox\n- the [Known Folder](https://msdn.microsoft.com/en-us/library/windows/desktop/dd378457.aspx) API on Windows\n- the [Standard Directories](https://developer.apple.com/library/content/documentation/FileManagement/Conceptual/FileSystemProgrammingGuide/FileSystemOverview/FileSystemOverview.html#//apple_ref/doc/uid/TP40010672-CH2-SW6)\n  guidelines on macOS\n\n## Platforms\n\nThis library is written in Rust, and supports Linux, Redox, macOS and Windows.\nOther platforms are also supported; they use the Linux conventions.\n\nThe minimal required version of Rust is 1.13 except for Redox, where the minimum Rust version\ndepends on the [`redox_users`](https://crates.io/crates/redox_users) crate.\n\nIt's mid-level sister library, _directories_, is available for Rust ([directories-rs](https://github.com/dirs-dev/directories-rs))\nand on the JVM ([directories-jvm](https://github.com/dirs-dev/directories-jvm)).\n\n## Usage\n\n#### Dependency\n\nAdd the library as a dependency to your project by inserting\n\n```toml\ndirs = \"5.0\"\n```\n\ninto the `[dependencies]` section of your Cargo.toml file.\n\nIf you are upgrading from version 2, please read the [section on breaking changes](#3) first.\n\n#### Example\n\nLibrary run by user Alice:\n\n```rust\nextern crate dirs;\n\ndirs::home_dir();\n// Lin: Some(/home/alice)\n// Win: Some(C:\\Users\\Alice)\n// Mac: Some(/Users/Alice)\n\ndirs::audio_dir();\n// Lin: Some(/home/alice/Music)\n// Win: Some(C:\\Users\\Alice\\Music)\n// Mac: Some(/Users/Alice/Music)\n\ndirs::config_dir();\n// Lin: Some(/home/alice/.config)\n// Win: Some(C:\\Users\\Alice\\AppData\\Roaming)\n// Mac: Some(/Users/Alice/Library/Application Support)\n\ndirs::executable_dir();\n// Lin: Some(/home/alice/.local/bin)\n// Win: None\n// Mac: None\n```\n\n## Design Goals\n\n- The _dirs_ library is a low-level crate designed to provide the paths to standard directories\n  as defined by operating systems rules or conventions.<br/>\n  If your requirements are more complex, e. g. computing cache, config, etc. paths for specific\n  applications or projects, consider using [directories](https://github.com/dirs-dev/directories-rs)\n  instead.\n- This library does not create directories or check for their existence. The library only provides\n  information on what the path to a certain directory _should_ be.<br/>\n  How this information is used is a decision that developers need to make based on the requirements\n  of each individual application.\n- This library is intentionally focused on providing information on user-writable directories only,\n  as there is no discernible benefit in returning a path that points to a user-level, writable\n  directory on one operating system, but a system-level, read-only directory on another.<br/>\n  The confusion and unexpected failure modes of such an approach would be immense.\n  - `executable_dir` is specified to provide the path to a user-writable directory for binaries.<br/>\n    As such a directory only commonly exists on Linux, it returns `None` on macOS and Windows.\n  - `font_dir` is specified to provide the path to a user-writable directory for fonts.<br/>\n    As such a directory only exists on Linux and macOS, it returns `None` on Windows.\n  - `runtime_dir` is specified to provide the path to a directory for non-essential runtime data.\n    It is required that this directory is created when the user logs in, is only accessible by the\n    user itself, is deleted when the user logs out, and supports all filesystem features of the\n    operating system.<br/>\n    As such a directory only commonly exists on Linux, it returns `None` on macOS and Windows.\n\n## Features\n\n**If you want to compute the location of cache, config or data directories for your own application or project,\nuse `ProjectDirs` of the [directories](https://github.com/dirs-dev/directories-rs) project instead.**\n\n| Function name      | Value on Linux/Redox                                                   | Value on Windows                  | Value on macOS                              |\n|--------------------| ---------------------------------------------------------------------- |-----------------------------------| ------------------------------------------- |\n| `home_dir`         | `Some($HOME)`                                                          | `Some({FOLDERID_Profile})`        | `Some($HOME)`                               |\n| `cache_dir`        | `Some($XDG_CACHE_HOME)`         or `Some($HOME`/.cache`)`              | `Some({FOLDERID_LocalAppData})`   | `Some($HOME`/Library/Caches`)`              |\n| `config_dir`       | `Some($XDG_CONFIG_HOME)`        or `Some($HOME`/.config`)`             | `Some({FOLDERID_RoamingAppData})` | `Some($HOME`/Library/Application Support`)` |\n| `config_local_dir` | `Some($XDG_CONFIG_HOME)`        or `Some($HOME`/.config`)`             | `Some({FOLDERID_LocalAppData})`   | `Some($HOME`/Library/Application Support`)` |\n| `data_dir`         | `Some($XDG_DATA_HOME)`          or `Some($HOME`/.local/share`)`        | `Some({FOLDERID_RoamingAppData})` | `Some($HOME`/Library/Application Support`)` |\n| `data_local_dir`   | `Some($XDG_DATA_HOME)`          or `Some($HOME`/.local/share`)`        | `Some({FOLDERID_LocalAppData})`   | `Some($HOME`/Library/Application Support`)` |\n| `executable_dir`   | `Some($XDG_BIN_HOME)`           or `Some($HOME`/.local/bin`)`          | `None`                            | `None`                                      |\n| `preference_dir`   | `Some($XDG_CONFIG_HOME)`        or `Some($HOME`/.config`)`             | `Some({FOLDERID_RoamingAppData})` | `Some($HOME`/Library/Preferences`)`         |\n| `runtime_dir`      | `Some($XDG_RUNTIME_DIR)`        or `None`                              | `None`                            | `None`                                      |\n| `state_dir`        | `Some($XDG_STATE_HOME)`         or `Some($HOME`/.local/state`)`        | `None`                            | `None`                                      |\n| `audio_dir`        | `Some(XDG_MUSIC_DIR)`           or `None`                              | `Some({FOLDERID_Music})`          | `Some($HOME`/Music/`)`                      |\n| `desktop_dir`      | `Some(XDG_DESKTOP_DIR)`         or `None`                              | `Some({FOLDERID_Desktop})`        | `Some($HOME`/Desktop/`)`                    |\n| `document_dir`     | `Some(XDG_DOCUMENTS_DIR)`       or `None`                              | `Some({FOLDERID_Documents})`      | `Some($HOME`/Documents/`)`                  |\n| `download_dir`     | `Some(XDG_DOWNLOAD_DIR)`        or `None`                              | `Some({FOLDERID_Downloads})`      | `Some($HOME`/Downloads/`)`                  |\n| `font_dir`         | `Some($XDG_DATA_HOME`/fonts/`)` or `Some($HOME`/.local/share/fonts/`)` | `None`                            | `Some($HOME`/Library/Fonts/`)`              |\n| `picture_dir`      | `Some(XDG_PICTURES_DIR)`        or `None`                              | `Some({FOLDERID_Pictures})`       | `Some($HOME`/Pictures/`)`                   |\n| `public_dir`       | `Some(XDG_PUBLICSHARE_DIR)`     or `None`                              | `Some({FOLDERID_Public})`         | `Some($HOME`/Public/`)`                     |\n| `template_dir`     | `Some(XDG_TEMPLATES_DIR)`       or `None`                              | `Some({FOLDERID_Templates})`      | `None`                                      |\n| `video_dir`        | `Some(XDG_VIDEOS_DIR)`          or `None`                              | `Some({FOLDERID_Videos})`         | `Some($HOME`/Movies/`)`                     |\n\n## Comparison\n\nThere are other crates in the Rust ecosystem that try similar or related things.\nHere is an overview of them, combined with ratings on properties that guided the design of this crate.\n\nPlease take this table with a grain of salt: a different crate might very well be more suitable for your specific use case.\n(Of course _my_ crate achieves _my_ design goals better than other crates, which might have had different design goals.)\n\n| Library                                                   | Status         | Lin | Mac | Win |Base|User|Proj|Conv|\n| --------------------------------------------------------- | -------------- |:---:|:---:|:---:|:--:|:--:|:--:|:--:|\n| [app_dirs](https://crates.io/crates/app_dirs)             | Unmaintained   |  ✔  |  ✔  |  ✔  | 🞈  | ✖  | ✔  | ✖  |\n| [app_dirs2](https://crates.io/crates/app_dirs2)           | Maintained     |  ✔  |  ✔  |  ✔  | 🞈  | ✖  | ✔  | ✖  |\n| **dirs**                                                  | **Developed**  |  ✔  |  ✔  |  ✔  | ✔  | ✔  | ✖  | ✔  |\n| [directories](https://crates.io/crates/directories)       | Developed      |  ✔  |  ✔  |  ✔  | ✔  | ✔  | ✔  | ✔  |\n| [s_app_dir](https://crates.io/crates/s_app_dir)           | Unmaintained?  |  ✔  |  ✖  |  🞈  | ✖  | ✖  | 🞈  | ✖  |\n| [standard_paths](https://crates.io/crates/standard_paths) | Maintained     |  ✔  |  ✖  |  ✔  | ✔  | ✔  | ✔  | ✖  |\n| [xdg](https://crates.io/crates/xdg)                       | Maintained     |  ✔  |  ✖  |  ✖  | ✔  | ✖  | ✔  | 🞈  |\n| [xdg-basedir](https://crates.io/crates/xdg-basedir)       | Unmaintained?  |  ✔  |  ✖  |  ✖  | ✔   | ✖  | ✖  | 🞈  |\n| [xdg-rs](https://crates.io/crates/xdg-rs)                 | Obsolete       |  ✔  |  ✖  |  ✖  | ✔   | ✖  | ✖  | 🞈  |\n\n- Lin: Linux support\n- Mac: macOS support\n- Win: Windows support\n- Base: Supports [generic base directories](https://github.com/dirs-dev/directories-rs#basedirs)\n- User: Supports [user directories](https://github.com/dirs-dev/directories-rs#userdirs)\n- Proj: Supports [project-specific base directories](https://github.com/dirs-dev/directories-rs#projectdirs)\n- Conv: Follows naming conventions of the operating system it runs on\n\n## Build\n\nIt's possible to cross-compile this library if the necessary toolchains are installed with rustup.\nThis is helpful to ensure a change hasn't broken code on a different platform.\n\nThe following commands will build this library on Linux, macOS and Windows:\n\n```\ncargo build --target=x86_64-unknown-linux-gnu\ncargo build --target=x86_64-pc-windows-gnu\ncargo build --target=x86_64-apple-darwin\ncargo build --target=x86_64-unknown-redox\n```\n\n## Changelog\n\n### 6\n\n- Update `dirs-sys` dependency to `0.5.0`, which in turn updates `windows-sys` dependency to `0.59.0`.\n\n### 5\n\n- Update `dirs-sys` dependency to `0.4.0`.\n- Add `config_local_dir` for non-roaming configuration on Windows. On non-Windows platforms the behavior is identical to `config dir`.\n\n### 4\n\n- **BREAKING CHANGE** The behavior of `executable_dir` has been adjusted to not depend on `$XDG_DATA_HOME`.\n  Code, which assumed that setting the `$XDG_DATA_HOME` environment variable also impacted `executable_dir` if\n  the `$XDG_BIN_HOME` environment variable was not set, requires adjustment.\n- Add support for `XDG_STATE_HOME`.\n\n### 3\n\n- **BREAKING CHANGE** The behavior of `config_dir` on macOS has been adjusted\n  (thanks to [everyone involved](https://github.com/dirs-dev/directories-rs/issues/62)):\n  - The existing `config_dir` function has been changed to return the `Application Support`\n    directory on macOS, as suggested by Apple documentation.\n  - The behavior of the `config_dir` function on non-macOS platforms has not been changed.\n  - If you have used the `config_dir` function to store files, it may be necessary to write code\n    that migrates the files to the new location on macOS.<br/>\n    (Alternative: change uses of the `config_dir` function to uses of the `preference_dir` function\n    to retain the old behavior.)\n- The newly added `preference_dir` function returns the `Preferences` directory on macOS now,\n  which – according to Apple documentation – shall only be used to store .plist files using\n  Apple-proprietary APIs.\n  – `preference_dir` and `config_dir` behave identical on non-macOS platforms.\n\n### 2\n\n**BREAKING CHANGE** The behavior of deactivated, missing or invalid [_XDG User Dirs_](https://www.freedesktop.org/wiki/Software/xdg-user-dirs/)\nentries on Linux has been improved (contributed by @tmiasko, thank you!):\n\n- Version 1 returned the user's home directory (`Some($HOME)`) for such faulty entries, except for a faulty `XDG_DESKTOP_DIR` entry which returned (`Some($HOME/Desktop)`).\n- Version 2 returns `None` for such entries.\n\n## License\n\nLicensed under either of\n\n * Apache License, Version 2.0\n   ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0)\n * MIT license\n   ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)\n\nat your option.\n\n## Contribution\n\nUnless you explicitly state otherwise, any contribution intentionally submitted\nfor inclusion in the work by you, as defined in the Apache-2.0 license, shall be\ndual licensed as above, without any additional terms or conditions.\n"
  },
  {
    "path": "src/lib.rs",
    "content": "//! The _dirs_ crate is\n//!\n//! - a tiny library with a minimal API (18 public functions)\n//! - that provides the platform-specific, user-accessible locations\n//! - for finding and storing configuration, cache and other data\n//! - on Linux, Redox, Windows (≥ Vista) and macOS.\n//!\n//! The library provides the location of these directories by leveraging the mechanisms defined by\n//!\n//! - the [XDG base directory](https://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html) and the [XDG user directory](https://www.freedesktop.org/wiki/Software/xdg-user-dirs/) specifications on Linux,\n//! - the [Known Folder](https://msdn.microsoft.com/en-us/library/windows/desktop/bb776911(v=vs.85).aspx) system on Windows, and\n//! - the [Standard Directories](https://developer.apple.com/library/content/documentation/FileManagement/Conceptual/FileSystemProgrammingGuide/FileSystemOverview/FileSystemOverview.html#//apple_ref/doc/uid/TP40010672-CH2-SW6) on macOS.\n\n#![deny(missing_docs)]\n\nuse std::path::PathBuf;\n\n#[cfg(target_os = \"windows\")]\nmod win;\n#[cfg(target_os = \"windows\")]\nuse win as sys;\n\n#[cfg(any(target_os = \"macos\", target_os = \"ios\"))]\nmod mac;\n#[cfg(any(target_os = \"macos\", target_os = \"ios\"))]\nuse mac as sys;\n\n#[cfg(target_arch = \"wasm32\")]\nmod wasm;\n#[cfg(target_arch = \"wasm32\")]\nuse wasm as sys;\n\n#[cfg(not(any(\n    target_os = \"windows\",\n    target_os = \"macos\", target_os = \"ios\",\n    target_arch = \"wasm32\"\n)))]\nmod lin;\n#[cfg(not(any(\n    target_os = \"windows\",\n    target_os = \"macos\", target_os = \"ios\",\n    target_arch = \"wasm32\"\n)))]\nuse lin as sys;\n\n/// Returns the path to the user's home directory.\n///\n/// The returned value depends on the operating system and is either a `Some`, containing a value from the following table, or a `None`.\n///\n/// |Platform | Value                | Example        |\n/// | ------- | -------------------- | -------------- |\n/// | Linux   | `$HOME`              | /home/alice    |\n/// | macOS   | `$HOME`              | /Users/Alice   |\n/// | Windows | `{FOLDERID_Profile}` | C:\\Users\\Alice |\n///\n/// ### Linux and macOS:\n///\n/// - Use `$HOME` if it is set and not empty.\n/// - If `$HOME` is not set or empty, then the function `getpwuid_r` is used to determine\n///   the home directory of the current user.\n/// - If `getpwuid_r` lacks an entry for the current user id or the home directory field is empty,\n///   then the function returns `None`.\n///\n/// ### Windows:\n///\n/// This function retrieves the user profile folder using `SHGetKnownFolderPath`.\n///\n/// All the examples on this page mentioning `$HOME` use this behavior.\n///\n/// _Note:_ This function's behavior differs from [`std::env::home_dir`],\n/// which works incorrectly on Linux, macOS and Windows.\n///\n/// [`std::env::home_dir`]: https://doc.rust-lang.org/std/env/fn.home_dir.html\npub fn home_dir() -> Option<PathBuf> {\n    sys::home_dir()\n}\n/// Returns the path to the user's cache directory.\n///\n/// The returned value depends on the operating system and is either a `Some`, containing a value from the following table, or a `None`.\n///\n/// |Platform | Value                               | Example                      |\n/// | ------- | ----------------------------------- | ---------------------------- |\n/// | Linux   | `$XDG_CACHE_HOME` or `$HOME`/.cache | /home/alice/.cache           |\n/// | macOS   | `$HOME`/Library/Caches              | /Users/Alice/Library/Caches  |\n/// | Windows | `{FOLDERID_LocalAppData}`           | C:\\Users\\Alice\\AppData\\Local |\npub fn cache_dir() -> Option<PathBuf> {\n    sys::cache_dir()\n}\n/// Returns the path to the user's config directory.\n///\n/// The returned value depends on the operating system and is either a `Some`, containing a value from the following table, or a `None`.\n///\n/// |Platform | Value                                 | Example                                  |\n/// | ------- | ------------------------------------- | ---------------------------------------- |\n/// | Linux   | `$XDG_CONFIG_HOME` or `$HOME`/.config | /home/alice/.config                      |\n/// | macOS   | `$HOME`/Library/Application Support   | /Users/Alice/Library/Application Support |\n/// | Windows | `{FOLDERID_RoamingAppData}`           | C:\\Users\\Alice\\AppData\\Roaming           |\npub fn config_dir() -> Option<PathBuf> {\n    sys::config_dir()\n}\n/// Returns the path to the user's local config directory.\n///\n/// The returned value depends on the operating system and is either a `Some`, containing a value from the following table, or a `None`.\n///\n/// |Platform | Value                                 | Example                                  |\n/// | ------- | ------------------------------------- | ---------------------------------------- |\n/// | Linux   | `$XDG_CONFIG_HOME` or `$HOME`/.config | /home/alice/.config                      |\n/// | macOS   | `$HOME`/Library/Application Support   | /Users/Alice/Library/Application Support |\n/// | Windows | `{FOLDERID_LocalAppData}`             | C:\\Users\\Alice\\AppData\\Local             |\npub fn config_local_dir() -> Option<PathBuf> {\n    sys::config_local_dir()\n}\n/// Returns the path to the user's data directory.\n///\n/// The returned value depends on the operating system and is either a `Some`, containing a value from the following table, or a `None`.\n///\n/// |Platform | Value                                    | Example                                  |\n/// | ------- | ---------------------------------------- | ---------------------------------------- |\n/// | Linux   | `$XDG_DATA_HOME` or `$HOME`/.local/share | /home/alice/.local/share                 |\n/// | macOS   | `$HOME`/Library/Application Support      | /Users/Alice/Library/Application Support |\n/// | Windows | `{FOLDERID_RoamingAppData}`              | C:\\Users\\Alice\\AppData\\Roaming           |\npub fn data_dir() -> Option<PathBuf> {\n    sys::data_dir()\n}\n/// Returns the path to the user's local data directory.\n///\n/// The returned value depends on the operating system and is either a `Some`, containing a value from the following table, or a `None`.\n///\n/// |Platform | Value                                    | Example                                  |\n/// | ------- | ---------------------------------------- | ---------------------------------------- |\n/// | Linux   | `$XDG_DATA_HOME` or `$HOME`/.local/share | /home/alice/.local/share                 |\n/// | macOS   | `$HOME`/Library/Application Support      | /Users/Alice/Library/Application Support |\n/// | Windows | `{FOLDERID_LocalAppData}`                | C:\\Users\\Alice\\AppData\\Local             |\npub fn data_local_dir() -> Option<PathBuf> {\n    sys::data_local_dir()\n}\n/// Returns the path to the user's executable directory.\n///\n/// The returned value depends on the operating system and is either a `Some`, containing a value from the following table, or a `None`.\n///\n/// |Platform | Value                                                            | Example                |\n/// | ------- | ---------------------------------------------------------------- | ---------------------- |\n/// | Linux   | `$XDG_BIN_HOME` or `$XDG_DATA_HOME`/../bin or `$HOME`/.local/bin | /home/alice/.local/bin |\n/// | macOS   | –                                                                | –                      |\n/// | Windows | –                                                                | –                      |\npub fn executable_dir() -> Option<PathBuf> {\n    sys::executable_dir()\n}\n/// Returns the path to the user's preference directory.\n///\n/// The returned value depends on the operating system and is either a `Some`, containing a value from the following table, or a `None`.\n///\n/// |Platform | Value                                 | Example                          |\n/// | ------- | ------------------------------------- | -------------------------------- |\n/// | Linux   | `$XDG_CONFIG_HOME` or `$HOME`/.config | /home/alice/.config              |\n/// | macOS   | `$HOME`/Library/Preferences           | /Users/Alice/Library/Preferences |\n/// | Windows | `{FOLDERID_RoamingAppData}`           | C:\\Users\\Alice\\AppData\\Roaming   |\npub fn preference_dir() -> Option<PathBuf> {\n    sys::preference_dir()\n}\n/// Returns the path to the user's runtime directory.\n///\n/// The runtime directory contains transient, non-essential data (like sockets or named pipes) that\n/// is expected to be cleared when the user's session ends.\n///\n/// The returned value depends on the operating system and is either a `Some`, containing a value from the following table, or a `None`.\n///\n/// |Platform | Value              | Example         |\n/// | ------- | ------------------ | --------------- |\n/// | Linux   | `$XDG_RUNTIME_DIR` | /run/user/1001/ |\n/// | macOS   | –                  | –               |\n/// | Windows | –                  | –               |\npub fn runtime_dir() -> Option<PathBuf> {\n    sys::runtime_dir()\n}\n/// Returns the path to the user's state directory.\n///\n/// The state directory contains data that should be retained between sessions (unlike the runtime\n/// directory), but may not be important/portable enough to be synchronized across machines (unlike\n/// the config/preferences/data directories).\n///\n/// The returned value depends on the operating system and is either a `Some`, containing a value from the following table, or a `None`.\n///\n/// |Platform | Value                                     | Example                  |\n/// | ------- | ----------------------------------------- | ------------------------ |\n/// | Linux   | `$XDG_STATE_HOME` or `$HOME`/.local/state | /home/alice/.local/state |\n/// | macOS   | –                                         | –                        |\n/// | Windows | –                                         | –                        |\npub fn state_dir() -> Option<PathBuf> {\n    sys::state_dir()\n}\n\n/// Returns the path to the user's audio directory.\n///\n/// The returned value depends on the operating system and is either a `Some`, containing a value from the following table, or a `None`.\n///\n/// |Platform | Value              | Example              |\n/// | ------- | ------------------ | -------------------- |\n/// | Linux   | `XDG_MUSIC_DIR`    | /home/alice/Music    |\n/// | macOS   | `$HOME`/Music      | /Users/Alice/Music   |\n/// | Windows | `{FOLDERID_Music}` | C:\\Users\\Alice\\Music |\npub fn audio_dir() -> Option<PathBuf> {\n    sys::audio_dir()\n}\n/// Returns the path to the user's desktop directory.\n///\n/// The returned value depends on the operating system and is either a `Some`, containing a value from the following table, or a `None`.\n///\n/// |Platform | Value                | Example                |\n/// | ------- | -------------------- | ---------------------- |\n/// | Linux   | `XDG_DESKTOP_DIR`    | /home/alice/Desktop    |\n/// | macOS   | `$HOME`/Desktop      | /Users/Alice/Desktop   |\n/// | Windows | `{FOLDERID_Desktop}` | C:\\Users\\Alice\\Desktop |\npub fn desktop_dir() -> Option<PathBuf> {\n    sys::desktop_dir()\n}\n/// Returns the path to the user's document directory.\n///\n/// The returned value depends on the operating system and is either a `Some`, containing a value from the following table, or a `None`.\n///\n/// |Platform | Value                  | Example                  |\n/// | ------- | ---------------------- | ------------------------ |\n/// | Linux   | `XDG_DOCUMENTS_DIR`    | /home/alice/Documents    |\n/// | macOS   | `$HOME`/Documents      | /Users/Alice/Documents   |\n/// | Windows | `{FOLDERID_Documents}` | C:\\Users\\Alice\\Documents |\npub fn document_dir() -> Option<PathBuf> {\n    sys::document_dir()\n}\n/// Returns the path to the user's download directory.\n///\n/// The returned value depends on the operating system and is either a `Some`, containing a value from the following table, or a `None`.\n///\n/// |Platform | Value                  | Example                  |\n/// | ------- | ---------------------- | ------------------------ |\n/// | Linux   | `XDG_DOWNLOAD_DIR`     | /home/alice/Downloads    |\n/// | macOS   | `$HOME`/Downloads      | /Users/Alice/Downloads   |\n/// | Windows | `{FOLDERID_Downloads}` | C:\\Users\\Alice\\Downloads |\npub fn download_dir() -> Option<PathBuf> {\n    sys::download_dir()\n}\n/// Returns the path to the user's font directory.\n///\n/// The returned value depends on the operating system and is either a `Some`, containing a value from the following table, or a `None`.\n///\n/// |Platform | Value                                                | Example                        |\n/// | ------- | ---------------------------------------------------- | ------------------------------ |\n/// | Linux   | `$XDG_DATA_HOME`/fonts or `$HOME`/.local/share/fonts | /home/alice/.local/share/fonts |\n/// | macOS   | `$HOME/Library/Fonts`                                | /Users/Alice/Library/Fonts     |\n/// | Windows | –                                                    | –                              |\npub fn font_dir() -> Option<PathBuf> {\n    sys::font_dir()\n}\n/// Returns the path to the user's picture directory.\n///\n/// The returned value depends on the operating system and is either a `Some`, containing a value from the following table, or a `None`.\n///\n/// |Platform | Value                 | Example                 |\n/// | ------- | --------------------- | ----------------------- |\n/// | Linux   | `XDG_PICTURES_DIR`    | /home/alice/Pictures    |\n/// | macOS   | `$HOME`/Pictures      | /Users/Alice/Pictures   |\n/// | Windows | `{FOLDERID_Pictures}` | C:\\Users\\Alice\\Pictures |\npub fn picture_dir() -> Option<PathBuf> {\n    sys::picture_dir()\n}\n/// Returns the path to the user's public directory.\n///\n/// The returned value depends on the operating system and is either a `Some`, containing a value from the following table, or a `None`.\n///\n/// |Platform | Value                 | Example             |\n/// | ------- | --------------------- | ------------------- |\n/// | Linux   | `XDG_PUBLICSHARE_DIR` | /home/alice/Public  |\n/// | macOS   | `$HOME`/Public        | /Users/Alice/Public |\n/// | Windows | `{FOLDERID_Public}`   | C:\\Users\\Public     |\npub fn public_dir() -> Option<PathBuf> {\n    sys::public_dir()\n}\n/// Returns the path to the user's template directory.\n///\n/// The returned value depends on the operating system and is either a `Some`, containing a value from the following table, or a `None`.\n///\n/// |Platform | Value                  | Example                                                    |\n/// | ------- | ---------------------- | ---------------------------------------------------------- |\n/// | Linux   | `XDG_TEMPLATES_DIR`    | /home/alice/Templates                                      |\n/// | macOS   | –                      | –                                                          |\n/// | Windows | `{FOLDERID_Templates}` | C:\\Users\\Alice\\AppData\\Roaming\\Microsoft\\Windows\\Templates |\npub fn template_dir() -> Option<PathBuf> {\n    sys::template_dir()\n}\n\n/// Returns the path to the user's video directory.\n///\n/// The returned value depends on the operating system and is either a `Some`, containing a value from the following table, or a `None`.\n///\n/// |Platform | Value               | Example               |\n/// | ------- | ------------------- | --------------------- |\n/// | Linux   | `XDG_VIDEOS_DIR`    | /home/alice/Videos    |\n/// | macOS   | `$HOME`/Movies      | /Users/Alice/Movies   |\n/// | Windows | `{FOLDERID_Videos}` | C:\\Users\\Alice\\Videos |\npub fn video_dir() -> Option<PathBuf> {\n    sys::video_dir()\n}\n\n#[cfg(test)]\nmod tests {\n    #[test]\n    fn test_dirs() {\n        println!(\"home_dir:       {:?}\", ::home_dir());\n        println!();\n        println!(\"cache_dir:      {:?}\", ::cache_dir());\n        println!(\"config_dir:     {:?}\", ::config_dir());\n        println!(\"data_dir:       {:?}\", ::data_dir());\n        println!(\"data_local_dir: {:?}\", ::data_local_dir());\n        println!(\"executable_dir: {:?}\", ::executable_dir());\n        println!(\"preference_dir: {:?}\", ::preference_dir());\n        println!(\"runtime_dir:    {:?}\", ::runtime_dir());\n        println!(\"state_dir:      {:?}\", ::state_dir());\n        println!();\n        println!(\"audio_dir:      {:?}\", ::audio_dir());\n        println!(\"desktop_dir:    {:?}\", ::desktop_dir());\n        println!(\"document_dir:   {:?}\", ::document_dir());\n        println!(\"download_dir:   {:?}\", ::download_dir());\n        println!(\"font_dir:       {:?}\", ::font_dir());\n        println!(\"picture_dir:    {:?}\", ::picture_dir());\n        println!(\"public_dir:     {:?}\", ::public_dir());\n        println!(\"template_dir:   {:?}\", ::template_dir());\n        println!(\"video_dir:      {:?}\", ::video_dir());\n    }\n}\n"
  },
  {
    "path": "src/lin.rs",
    "content": "extern crate dirs_sys;\n\nuse std::env;\nuse std::path::PathBuf;\n\npub fn home_dir()         -> Option<PathBuf> { dirs_sys::home_dir() }\n\npub fn cache_dir()        -> Option<PathBuf> { env::var_os(\"XDG_CACHE_HOME\") .and_then(dirs_sys::is_absolute_path).or_else(|| home_dir().map(|h| h.join(\".cache\"))) }\npub fn config_dir()       -> Option<PathBuf> { env::var_os(\"XDG_CONFIG_HOME\").and_then(dirs_sys::is_absolute_path).or_else(|| home_dir().map(|h| h.join(\".config\"))) }\npub fn config_local_dir() -> Option<PathBuf> { config_dir() }\npub fn data_dir()         -> Option<PathBuf> { env::var_os(\"XDG_DATA_HOME\")  .and_then(dirs_sys::is_absolute_path).or_else(|| home_dir().map(|h| h.join(\".local/share\"))) }\npub fn data_local_dir()   -> Option<PathBuf> { data_dir() }\npub fn preference_dir()   -> Option<PathBuf> { config_dir() }\npub fn runtime_dir()      -> Option<PathBuf> { env::var_os(\"XDG_RUNTIME_DIR\").and_then(dirs_sys::is_absolute_path) }\npub fn state_dir()        -> Option<PathBuf> { env::var_os(\"XDG_STATE_HOME\") .and_then(dirs_sys::is_absolute_path).or_else(|| home_dir().map(|h| h.join(\".local/state\"))) }\npub fn executable_dir()   -> Option<PathBuf> { env::var_os(\"XDG_BIN_HOME\")   .and_then(dirs_sys::is_absolute_path).or_else(|| home_dir().map(|h| h.join(\".local/bin\"))) }\n\npub fn audio_dir()        -> Option<PathBuf> { dirs_sys::user_dir(\"MUSIC\") }\npub fn desktop_dir()      -> Option<PathBuf> { dirs_sys::user_dir(\"DESKTOP\") }\npub fn document_dir()     -> Option<PathBuf> { dirs_sys::user_dir(\"DOCUMENTS\") }\npub fn download_dir()     -> Option<PathBuf> { dirs_sys::user_dir(\"DOWNLOAD\") }\npub fn font_dir()         -> Option<PathBuf> { data_dir().map(|d| d.join(\"fonts\")) }\npub fn picture_dir()      -> Option<PathBuf> { dirs_sys::user_dir(\"PICTURES\") }\npub fn public_dir()       -> Option<PathBuf> { dirs_sys::user_dir(\"PUBLICSHARE\") }\npub fn template_dir()     -> Option<PathBuf> { dirs_sys::user_dir(\"TEMPLATES\") }\npub fn video_dir()        -> Option<PathBuf> { dirs_sys::user_dir(\"VIDEOS\") }\n\n#[cfg(test)]\nmod tests {\n    #[test]\n    fn test_file_user_dirs_exists() {\n        let user_dirs_file = ::config_dir().unwrap().join(\"user-dirs.dirs\");\n        println!(\"{:?} exists: {:?}\", user_dirs_file, user_dirs_file.exists());\n    }\n}\n"
  },
  {
    "path": "src/mac.rs",
    "content": "extern crate dirs_sys;\n\nuse std::path::PathBuf;\n\npub fn home_dir()         -> Option<PathBuf> { dirs_sys::home_dir() }\n\nfn app_support_dir()       -> Option<PathBuf> { home_dir().map(|h| h.join(\"Library/Application Support\")) }\n\npub fn cache_dir()        -> Option<PathBuf> { home_dir().map(|h| h.join(\"Library/Caches\")) }\npub fn config_dir()       -> Option<PathBuf> { app_support_dir() }\npub fn config_local_dir() -> Option<PathBuf> { app_support_dir() }\npub fn data_dir()         -> Option<PathBuf> { app_support_dir() }\npub fn data_local_dir()   -> Option<PathBuf> { app_support_dir() }\npub fn preference_dir()   -> Option<PathBuf> { home_dir().map(|h| h.join(\"Library/Preferences\")) }\npub fn executable_dir()   -> Option<PathBuf> { None }\npub fn runtime_dir()      -> Option<PathBuf> { None }\npub fn state_dir()        -> Option<PathBuf> { None }\n\npub fn audio_dir()        -> Option<PathBuf> { home_dir().map(|h| h.join(\"Music\")) }\npub fn desktop_dir()      -> Option<PathBuf> { home_dir().map(|h| h.join(\"Desktop\")) }\npub fn document_dir()     -> Option<PathBuf> { home_dir().map(|h| h.join(\"Documents\")) }\npub fn download_dir()     -> Option<PathBuf> { home_dir().map(|h| h.join(\"Downloads\")) }\npub fn font_dir()         -> Option<PathBuf> { home_dir().map(|h| h.join(\"Library/Fonts\")) }\npub fn picture_dir()      -> Option<PathBuf> { home_dir().map(|h| h.join(\"Pictures\")) }\npub fn public_dir()       -> Option<PathBuf> { home_dir().map(|h| h.join(\"Public\")) }\npub fn template_dir()     -> Option<PathBuf> { None }\npub fn video_dir()        -> Option<PathBuf> { home_dir().map(|h| h.join(\"Movies\")) }\n"
  },
  {
    "path": "src/wasm.rs",
    "content": "// Stub definitions to make things *compile*.\n\nuse std::path::PathBuf;\n\npub fn home_dir()         -> Option<PathBuf> { None }\n\npub fn cache_dir()        -> Option<PathBuf> { None }\npub fn config_dir()       -> Option<PathBuf> { None }\npub fn config_local_dir() -> Option<PathBuf> { None }\npub fn data_dir()         -> Option<PathBuf> { None }\npub fn data_local_dir()   -> Option<PathBuf> { None }\npub fn preference_dir()   -> Option<PathBuf> { None }\npub fn runtime_dir()      -> Option<PathBuf> { None }\npub fn executable_dir()   -> Option<PathBuf> { None }\npub fn state_dir()        -> Option<PathBuf> { None }\n\npub fn audio_dir()        -> Option<PathBuf> { None }\npub fn desktop_dir()      -> Option<PathBuf> { None }\npub fn document_dir()     -> Option<PathBuf> { None }\npub fn download_dir()     -> Option<PathBuf> { None }\npub fn font_dir()         -> Option<PathBuf> { None }\npub fn picture_dir()      -> Option<PathBuf> { None }\npub fn public_dir()       -> Option<PathBuf> { None }\npub fn template_dir()     -> Option<PathBuf> { None }\npub fn video_dir()        -> Option<PathBuf> { None }\n"
  },
  {
    "path": "src/win.rs",
    "content": "extern crate dirs_sys;\n\nuse std::path::PathBuf;\n\npub fn home_dir()         -> Option<PathBuf> { dirs_sys::known_folder_profile() }\n\npub fn cache_dir()        -> Option<PathBuf> { data_local_dir() }\npub fn config_dir()       -> Option<PathBuf> { dirs_sys::known_folder_roaming_app_data() }\npub fn config_local_dir() -> Option<PathBuf> { dirs_sys::known_folder_local_app_data() }\npub fn data_dir()         -> Option<PathBuf> { dirs_sys::known_folder_roaming_app_data() }\npub fn data_local_dir()   -> Option<PathBuf> { dirs_sys::known_folder_local_app_data() }\npub fn executable_dir()   -> Option<PathBuf> { None }\npub fn preference_dir()   -> Option<PathBuf> { dirs_sys::known_folder_local_app_data() }\npub fn runtime_dir()      -> Option<PathBuf> { None }\npub fn state_dir()        -> Option<PathBuf> { None }\n\npub fn audio_dir()        -> Option<PathBuf> { dirs_sys::known_folder_music() }\npub fn desktop_dir()      -> Option<PathBuf> { dirs_sys::known_folder_desktop() }\npub fn document_dir()     -> Option<PathBuf> { dirs_sys::known_folder_documents() }\npub fn download_dir()     -> Option<PathBuf> { dirs_sys::known_folder_downloads() }\npub fn font_dir()         -> Option<PathBuf> { None }\npub fn picture_dir()      -> Option<PathBuf> { dirs_sys::known_folder_pictures() }\npub fn public_dir()       -> Option<PathBuf> { dirs_sys::known_folder_public()}\npub fn template_dir()     -> Option<PathBuf> { dirs_sys::known_folder_templates() }\npub fn video_dir()        -> Option<PathBuf> { dirs_sys::known_folder_videos() }\n"
  }
]