{"id":16843766,"url":"https://github.com/stevelauc/unixpermissionsext","last_synced_at":"2025-03-18T05:44:16.080Z","repository":{"id":60965305,"uuid":"547091867","full_name":"SteveLauC/UNIXPermissionsExt","owner":"SteveLauC","description":"A trivial trait bringing missing functions that are not exposed by PermissionsExt to Permissions on UNIX platforms.","archived":false,"fork":false,"pushed_at":"2022-10-08T10:30:56.000Z","size":18,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-28T07:02:44.323Z","etag":null,"topics":["file-permissions","set-gid","set-uid","sticky-bit","unix"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SteveLauC.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-10-07T05:51:20.000Z","updated_at":"2022-10-07T08:01:23.000Z","dependencies_parsed_at":"2023-01-19T16:03:07.620Z","dependency_job_id":null,"html_url":"https://github.com/SteveLauC/UNIXPermissionsExt","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SteveLauC%2FUNIXPermissionsExt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SteveLauC%2FUNIXPermissionsExt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SteveLauC%2FUNIXPermissionsExt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SteveLauC%2FUNIXPermissionsExt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SteveLauC","download_url":"https://codeload.github.com/SteveLauC/UNIXPermissionsExt/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244166639,"owners_count":20409177,"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","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":["file-permissions","set-gid","set-uid","sticky-bit","unix"],"created_at":"2024-10-13T12:53:35.857Z","updated_at":"2025-03-18T05:44:16.063Z","avatar_url":"https://github.com/SteveLauC.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"## UNIXPermissionsExt\n\n[![BUILD](https://github.com/stevelauc/UNIXPermissionsExt/workflows/Rust/badge.svg)](https://github.com/stevelauc/UNIXPermissionsExt/actions/workflows/build.yml)\n[![crates.io](https://img.shields.io/crates/v/unix_permissions_ext.svg)](https://crates.io/crates/unix_permissions_ext)\n[![docs.rs](https://docs.rs/unix_permissions_ext/badge.svg)](https://docs.rs/unix_permissions_ext)\n\nA trivial trait bringing missing functions that are not exposed by\n[`std::os::unix::fs::PermissionsExt`](https://doc.rust-lang.org/std/os/unix/fs/trait.PermissionsExt.html)\nto [`std::fs::Permissions`](https://doc.rust-lang.org/std/fs/struct.Permissions.html)\non UNIX platforms.\n\n```rust\npub trait UNIXPermissionsExt {\n    fn set_uid(\u0026self) -\u003e bool;\n    fn set_gid(\u0026self) -\u003e bool;\n    fn sticky_bit(\u0026self) -\u003e bool;\n    fn readable_by_owner(\u0026self) -\u003e bool;\n    fn writable_by_owner(\u0026self) -\u003e bool;\n    fn executable_by_owner(\u0026self) -\u003e bool;\n    fn readable_by_group(\u0026self) -\u003e bool;\n    fn writable_by_group(\u0026self) -\u003e bool;\n    fn executable_by_group(\u0026self) -\u003e bool;\n    fn readable_by_other(\u0026self) -\u003e bool;\n    fn writable_by_other(\u0026self) -\u003e bool;\n    fn executable_by_other(\u0026self) -\u003e bool;\n    fn stringify(\u0026self) -\u003e String;\n}\n\nimpl UNIXPermissionsExt for Permissions {\n    ...\n}\n```\n\n## Usage\n\n1. Add it to your dependency:\n\n   ```shell\n   $ cd $YOUR_PROJECT\n   $ cargo add unix_permissions_ext\n   ```\n\n2. Import this trait and use it just like you are using the standard library!\n\n   ```rust\n   use std::fs::metadata;\n   use unix_permissions_ext::UNIXPermissionsExt;\n   \n   let metadata = metadata(\"/usr/bin/passwd\").expect(\"can not fetch metadata\");\n   let permission = metadata.permissions();\n   \n   assert!(permission.set_uid());\n   println!(\"Permission: {}\", permission.stringify());\n   ``` \n\n3. To use these functions directly with the `mode_t` type, consider importing `raw_fn` module:\n   \n   ```rust\n   use unix_permissions_ext::raw_fn::*;\n   ```  \n\n## Contributing\n\nContributions of all forms are welcome, feel free to file an issue or make a pull request!\n\n#### Test before your commit\n\n1. Pass the tests\n\n   ```shell\n   $ cargo test\n   ``` \n2. Format your code\n\n   ```shell\n   $ cargo fmt\n   ```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstevelauc%2Funixpermissionsext","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstevelauc%2Funixpermissionsext","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstevelauc%2Funixpermissionsext/lists"}