Coder Social home page Coder Social logo

wmc's Introduction

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.

wmc's People

Contributors

h2cone avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.