{"id":26057696,"url":"https://github.com/feenkcom/file-matcher-rs","last_synced_at":"2025-04-11T05:07:17.871Z","repository":{"id":57629291,"uuid":"386642482","full_name":"feenkcom/file-matcher-rs","owner":"feenkcom","description":"A Rust library to search files based on the name pattern (regex, wildcard, exact).","archived":false,"fork":false,"pushed_at":"2021-10-13T05:49:17.000Z","size":40,"stargazers_count":7,"open_issues_count":0,"forks_count":1,"subscribers_count":10,"default_branch":"main","last_synced_at":"2025-04-11T05:07:01.778Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/feenkcom.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":"2021-07-16T13:13:51.000Z","updated_at":"2024-12-12T15:44:50.000Z","dependencies_parsed_at":"2022-09-18T06:04:20.083Z","dependency_job_id":null,"html_url":"https://github.com/feenkcom/file-matcher-rs","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/feenkcom%2Ffile-matcher-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/feenkcom%2Ffile-matcher-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/feenkcom%2Ffile-matcher-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/feenkcom%2Ffile-matcher-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/feenkcom","download_url":"https://codeload.github.com/feenkcom/file-matcher-rs/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248345266,"owners_count":21088244,"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":"2025-03-08T11:58:24.487Z","updated_at":"2025-04-11T05:07:17.843Z","avatar_url":"https://github.com/feenkcom.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# file-matcher\n[![docs](https://docs.rs/file-matcher/badge.svg)](https://docs.rs/file-matcher)\n[![crate](https://img.shields.io/crates/v/file-matcher.svg?color=orange)](https://crates.io/crates/file-matcher)\n[![license](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\nA Rust library to search files and folders based on the name pattern (regex, wildcard, exact).\n\n### Features\n* `regex` - adds regex support using [Regex crate](https://crates.io/crates/regex)\n* `wildmatch` - adds a wildcard matching using [Wildmatch crate](https://crates.io/crates/wildmatch)\n* `copier` - allows users to copy declared files and folders, uses [fs_extra crate](https://crates.io/crates/fs_extra)\n* `mover` - allows users to move declared files and folders, uses [fs_extra crate](https://crates.io/crates/fs_extra)\n* `serde` - allows users to serialize / deserialize declared file and folder filters, uses [serde](https://crates.io/crates/serde)\n\n### Search\n\nUse `FileNamed` to search for exactly one file matching the name pattern. Returns an `Error` if none or more than one file was found.\n```rust\nFileNamed::regex(\"cat.*\")\n    .within(\"tests/assets\")\n    .find()?\n```\n\nUse `FolderNamed` to search for exactly one folder matching the name pattern. Returns an `Error` if none or more than one folder was found.\n```rust\nFolderNamed::wildmatch(\"cat*\")\n    .within(\"tests/assets\")\n    .find()?\n```\n\n### Existence\n\nCheck if a file exists:\n```rust\nFileNamed::wildmatch(\"cat*\")\n    .within(\"tests/assets\")\n    .exists()?\n```\n\nCheck if a folder exists:\n```rust\nFolderNamed::wildmatch(\"cat*\")\n    .within(\"tests/assets\")\n    .exists()?\n```\n\n### Copy\n\nFind and copy a file matching a name pattern to `destination` folder under the same name:\n```rust\nFileNamed::wildmatch(\"cat*\")\n    .within(\"tests/assets\")\n    .copy(\"destination\")?\n```\n\nFind and copy a file matching a name pattern to `destination` folder as `kitty.txt`:\n```rust\nFileNamed::wildmatch(\"cat*\")\n    .within(\"tests/assets\")\n    .copy(Path::new(\"destination\").join(\"kitty.txt\"))?\n```\n\nAlternatively, assign an alias for copy/move operations.\nThe following will find a file matching a given pattern name and will copy it into the `destination` folder under the `kitty.txt` name:\n```rust\nFileNamed::wildmatch(\"cat*\")\n    .alias(\"kitty.txt\")\n    .within(\"tests/assets\")\n    .copy(\"destination\")?\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffeenkcom%2Ffile-matcher-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffeenkcom%2Ffile-matcher-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffeenkcom%2Ffile-matcher-rs/lists"}