Skip to content
/ wmc Public

Watching, Matching, and Copying new files from one directory to another.

License

Notifications You must be signed in to change notification settings

h2cone/wmc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

wmc

This is a Rust project that uses the futures, notify, and regex libraries. The main functionality of this project is to watch a specified source directory for file changes and copy the changed files to a destination directory if the file path matches a given regular expression.

Usage

To run the program, use the following command:

cargo run <source_path> <regex> <destination_path>

Where:

  • <source_path> is the path to the source directory you want to watch.
  • <regex> is the regular expression that the file path needs to match.
  • <destination_path> is the path to the destination directory where the files will be copied to.

Functionality

The main function initializes the logger, retrieves the command line arguments, and starts the asynchronous file watcher.

The async_watcher function creates a new file watcher and a channel for sending file change events.

The async_watch function starts watching the specified source directory for file changes. If a file change event is received and the file path matches the given regular expression, the file is copied to the destination directory.

Dependencies

This project uses the following dependencies:

  • futures: for asynchronous programming.
  • notify: for watching file changes.
  • regex: for matching file paths with a regular expression.

Please replace <source_path>, <regex>, and <destination_path> with actual values when running the program.

About

Watching, Matching, and Copying new files from one directory to another.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages