file-matcher
A Rust library to search files and folders based on the name pattern (regex, wildcard, exact).
Features
regex
- adds regex support using Regex cratewildmatch
- adds a wildcard matching using Wildmatch cratecopier
- allows users to copy declared files and folders, uses fs_extra cratemover
- allows users to move declared files and folders, uses fs_extra crateserde
- allows users to serialize / deserialize declared file and folder filters, uses serde
Search
Use FileNamed
to search for exactly one file matching the name pattern. Returns an Error
if none or more than one file was found.
.within
.find?
regex
Use FolderNamed
to search for exactly one folder matching the name pattern. Returns an Error
if none or more than one folder was found.
.within
.find?
wildmatch
Existence
Check if a file exists:
.within
.exists?
wildmatch
Check if a folder exists:
.within
.exists?
wildmatch
Copy
Find and copy a file matching a name pattern to destination
folder under the same name:
.within
.copy?
wildmatch
Find and copy a file matching a name pattern to destination
folder as kitty.txt
:
.within
.copy?
wildmatch
Alternatively, assign an alias for copy/move operations.
The following will find a file matching a given pattern name and will copy it into the destination
folder under the kitty.txt
name:
.alias
.within
.copy?
wildmatch