fswatcher

Crates.iofswatcher
lib.rsfswatcher
version0.4.2
created_at2025-02-18 01:11:11.215501+00
updated_at2025-04-19 14:32:45.542726+00
descriptionA file system watcher that executes a command when a specified file changes.
homepage
repositoryhttps://github.com/jmarcelomb/fswatcher
max_upload_size
id1559510
size38,510
Marcelo Borges (jmarcelomb)

documentation

README

fswatcher

Crates.io License Downloads

📌 Overview

fswatcher is a simple CLI tool to monitor file changes and execute a command when modifications are detected. It is built with Rust and utilizes the notify crate for efficient filesystem event watching.

🚀 Installation

You can install fswatcher using Cargo:

cargo install fswatcher

🛠 Usage

Run fswatcher by specifying a file to watch and a command to execute when the file changes:

fswatcher <file> <command>

Example:

fswatcher config.yaml 'echo "Config changed!"'

This will monitor config.yaml and print "Config changed!" whenever the file is modified.

✨ Features

  • Watches a specified file for changes
  • Executes a command automatically upon file modification
  • Uses a lock mechanism to prevent same command duplicate execution

🔧 Development

Clone the repository and build locally:

git clone https://github.com/jmarcelomb/fswatcher.git
cd fswatcher
cargo build --release

Run the tool with:

cargo run -- <file> <command>

📜 License

This project is licensed under the MIT License - see the LICENSE file for details.

🙌 Contribution

Contributions, issues, and feature requests are welcome! Feel free to open an issue or submit a pull request.


Created by Marcelo Borges.

Commit count: 72

cargo fmt