{"id":18560934,"url":"https://github.com/artichoke/sysdir-rs","last_synced_at":"2025-08-18T23:04:09.998Z","repository":{"id":164309888,"uuid":"639741238","full_name":"artichoke/sysdir-rs","owner":"artichoke","description":"🍎 📁 Rust bindings to `sysdir` API on Apple platforms","archived":false,"fork":false,"pushed_at":"2025-08-12T00:15:39.000Z","size":1826,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"trunk","last_synced_at":"2025-08-12T02:28:55.300Z","etag":null,"topics":["artichoke","bindgen","ios","knownfolders","macos","rust","rust-crate","sysdir","tvos","watchos"],"latest_commit_sha":null,"homepage":"https://crates.io/crates/sysdir","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/artichoke.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-05-12T06:00:14.000Z","updated_at":"2025-08-03T17:17:09.000Z","dependencies_parsed_at":null,"dependency_job_id":"3b42dc61-dc49-4aab-a13e-c1e5db63cdd9","html_url":"https://github.com/artichoke/sysdir-rs","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/artichoke/sysdir-rs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/artichoke%2Fsysdir-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/artichoke%2Fsysdir-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/artichoke%2Fsysdir-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/artichoke%2Fsysdir-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/artichoke","download_url":"https://codeload.github.com/artichoke/sysdir-rs/tar.gz/refs/heads/trunk","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/artichoke%2Fsysdir-rs/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271073387,"owners_count":24694538,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-18T02:00:08.743Z","response_time":89,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["artichoke","bindgen","ios","knownfolders","macos","rust","rust-crate","sysdir","tvos","watchos"],"created_at":"2024-11-06T22:05:10.951Z","updated_at":"2025-08-18T23:04:09.986Z","avatar_url":"https://github.com/artichoke.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# sysdir-rs\n\n[![GitHub Actions](https://github.com/artichoke/sysdir-rs/workflows/CI/badge.svg)](https://github.com/artichoke/sysdir-rs/actions)\n[![Discord](https://img.shields.io/discord/607683947496734760)](https://discord.gg/QCe2tp2)\n[![Twitter](https://img.shields.io/twitter/follow/artichokeruby?label=Follow\u0026style=social)](https://twitter.com/artichokeruby)\n\u003cbr\u003e\n[![Crate](https://img.shields.io/crates/v/sysdir.svg)](https://crates.io/crates/sysdir)\n[![API](https://docs.rs/sysdir/badge.svg)](https://docs.rs/sysdir)\n[![API trunk](https://img.shields.io/badge/docs-trunk-blue.svg)](https://artichoke.github.io/sysdir-rs/sysdir/)\n\nEnumeration of the filesystem paths for the various standard system directories\nwhere apps, resources, etc. get installed.\n\nThis crate exposes Rust bindings to the `sysdir(3)` library functions provided\nby `libSystem.dylib` on macOS, iOS, tvOS, and watchOS.\n\nThe `sysdir` API first appeared in OS X 10.12, iOS 10, watchOS 3 and tvOS 10\nreplacing the deprecated `NSSystemDirectories(3)` API.\n\n## Usage\n\nAdd this to your `Cargo.toml`:\n\n```toml\n[dependencies]\nsysdir = \"1.3.0\"\n```\n\nThen resolve well-known directories like this:\n\n```rust\nuse core::ffi::{c_char, CStr};\n\nuse sysdir::*;\n\nlet mut path = [0; PATH_MAX as usize];\n\nlet dir = sysdir_search_path_directory_t::SYSDIR_DIRECTORY_USER;\nlet domain_mask = SYSDIR_DOMAIN_MASK_LOCAL;\n\nunsafe {\n    let mut state = sysdir_start_search_path_enumeration(dir, domain_mask);\n    loop {\n        let path = path.as_mut_ptr().cast::\u003cc_char\u003e();\n        state = sysdir_get_next_search_path_enumeration(state, path);\n        if state == 0 {\n            break;\n        }\n        let path = CStr::from_ptr(path);\n        let s = path.to_str().unwrap();\n        assert_eq!(s, \"/Users\");\n    }\n}\n```\n\nYou can test this crate works on your platform by running the example:\n\n```shell\ncargo run --example enumerate_system_dirs\n```\n\n## Implementation\n\nsysdir-rs binds directly to `libSystem` with vendored bindings generated by\n[`bindgen`][rust-bindgen]. This crate has no dependencies other than\n`libSystem`.\n\n[rust-bindgen]: https://rust-lang.github.io/rust-bindgen/\n\nNote that this crate is completely empty on non-Apple platforms.\n\n## `no_std`\n\nsysdir-rs is `no_std` and only requires `core`.\n\n## Minimum Supported Rust Version\n\nThis crate requires at least Rust 1.85.0. This version can be bumped in minor\nreleases.\n\n## License\n\n`sysdir-rs` is distributed under the terms of either the\n[MIT License](LICENSE-MIT) or the\n[Apache License (Version 2.0)](LICENSE-APACHE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fartichoke%2Fsysdir-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fartichoke%2Fsysdir-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fartichoke%2Fsysdir-rs/lists"}