{"id":16853532,"url":"https://github.com/cosmichorrordev/rand-dir","last_synced_at":"2025-03-18T10:24:36.669Z","repository":{"id":132735348,"uuid":"385447781","full_name":"CosmicHorrorDev/rand-dir","owner":"CosmicHorrorDev","description":"Easily create complex test directories","archived":false,"fork":false,"pushed_at":"2021-08-12T21:44:40.000Z","size":37,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-24T16:44:12.094Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/CosmicHorrorDev.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}},"created_at":"2021-07-13T02:25:45.000Z","updated_at":"2021-08-12T21:44:43.000Z","dependencies_parsed_at":null,"dependency_job_id":"375e85f9-d8a5-41de-a81d-0c40b577d9cd","html_url":"https://github.com/CosmicHorrorDev/rand-dir","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/CosmicHorrorDev%2Frand-dir","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CosmicHorrorDev%2Frand-dir/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CosmicHorrorDev%2Frand-dir/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CosmicHorrorDev%2Frand-dir/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CosmicHorrorDev","download_url":"https://codeload.github.com/CosmicHorrorDev/rand-dir/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244199656,"owners_count":20414694,"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":[],"created_at":"2024-10-13T13:52:02.373Z","updated_at":"2025-03-18T10:24:36.647Z","avatar_url":"https://github.com/CosmicHorrorDev.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# _rand-dir_\n\nEasily construct complex directory structures\n\nThis is primarily focused towards property testing where the exact contents of\ndifferent files or entry's names may not matter since you are only concerned\nabout your program upholding certain properties like a directory being\nidentical when compressed and then decompressed or that it traverses symlinks\nproperly\n\n## Quickstart\n\n```rust\nuse rand_dir::{Dir, File, RandDir};\n\nfn main() -\u003e Result\u003c(), Box\u003cdyn std::error::Error\u003e\u003e {\n    let rand_dir = RandDir::builder()\n        .dir(\n            Dir::real()\n                .file(File::zeroed())\n                .file(File::oned())\n        )\n        .dir(\n            Dir::symlink()\n                .file(File::random())\n        )\n        .file(File::custom(*b\"Hello, World!\"))\n        .try_build()?;\n\n    println!(\"Base of directory at {:?}\", rand_dir.at());\n\n    Ok(())\n}  // \u003c-- Directory is cleaned up when it goes out of scope\n```\n\nWill create a temporary directory like below where the `base` directory can be\naccessed with `rand_dir.at()`\n\n```text\n Size Name\n    - /tmp/rand-dir-.XHiQMQpuhnTH\n    - ├── base\n    - │  ├── dir-deep-goose\n4.0Ki │  │  ├── file-ultimate-piglet.oned\n4.0Ki │  │  └── file-verified-hamster.zeroed\n   13 │  ├── file-grateful-flamingo.custom\n   51 │  └── symlink-champion-shrimp -\u003e /tmp/rand-dir-.XHiQMQpuhnTH/symlinks/symlink-dest-1\n    - ├── broken-symlinks\n    - └── symlinks\n    -    └── symlink-dest-1\n4.0Ki       └── file-legal-sunbeam.random\n```\n\nand if needed the names, permissions, and filesizes can all be customized by\ncalling the relevant methods on each entry\n\n## License\n\nLicensed under either of\n\n - Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0)\n - MIT license ([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\nbe dual licensed as above, without any additional terms or conditions.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcosmichorrordev%2Frand-dir","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcosmichorrordev%2Frand-dir","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcosmichorrordev%2Frand-dir/lists"}