Contents

Chapter 1

Features

This chapter covers the core features and capabilities of File Watcher.

Features

  • Directory monitoring — Poll-based filesystem watching (works on any OS)
  • Glob pattern matching — Watch only *.py, *.csv, data/*.json, etc.
  • Recursive watching — Monitor subdirectories automatically
  • Debouncing — Configurable delay to batch rapid changes into single events
  • Shell command triggers — Run any command on file change
  • Webhook triggers — POST change events to any HTTP endpoint
  • Log triggers — Structured log entries for audit trails
  • Checksum detection — Optional MD5 checksums for content-aware change detection
  • Multi-rule support — Watch different directories with different patterns and actions
  • Event history — SQLite log of all detected changes

Requirements

  • Python 3.10+
  • No external dependencies (stdlib only)
Chapter 2

Quick Start

Follow this guide to get File Watcher up and running in your environment.

Quick Start

bash
# Watch a directory and run tests on Python file changes
python src/file_watcher.py --watch ./src --pattern "*.py" --command "python -m pytest"

# Watch for CSV changes and hit a webhook
python src/file_watcher.py --watch ./data --pattern "*.csv" \
    --webhook https://api.example.com/v1/reload

# Use a config file for complex setups
python src/file_watcher.py --config examples/watcher_config.json

# Watch with content-aware checksums (detects real content changes, not just timestamps)
python src/file_watcher.py --watch ./src --pattern "*.py" --checksums --command "make build"

Configuration Reference

json
{
    "rules": [
        {
            "name": "python-tests",
            "watch_path": "./src",
            "patterns": ["*.py"],
            "recursive": true,
            "actions": [
                {"type": "command", "command": "python -m pytest tests/"},
                {"type": "log"}
            ]
        },
        {
            "name": "data-reload",
            "watch_path": "./data",
            "patterns": ["*.csv", "*.json"],
            "recursive": false,
            "actions": [
                {"type": "webhook", "url": "https://api.example.com/v1/reload"},
                {"type": "command", "command": "python scripts/validate_data.py"}
            ]
        }
    ],
    "poll_interval": 2.0,
    "debounce": 0.5,
    "use_checksums": true
}

CLI Options

FlagDefaultDescription
--config, -c—Watcher config file (JSON)
--watch, -w—Directory to watch
--pattern, -p*Glob pattern to match
--command—Shell command to run on file change
--webhook—Webhook URL to notify on file change
--poll-interval2.0Seconds between filesystem scans
--recursivetrueWatch subdirectories
--no-recursive—Disable recursive watching
--checksumsfalseUse MD5 checksums for change detection
--log-levelINFOLogging level

Action Types

TypeDescriptionConfig Fields
commandRun a shell commandcommand (string)
webhookPOST to a URLurl (string)
logWrite structured log entry—
Chapter 3
🔒 Available in full product

FAQ

You’ve reached the end of the free preview

Get the full File Watcher and unlock everything.

All Chapters

Get the complete guide with every chapter unlocked, including code samples, diagrams, and best practices.

Full Tool Suite

Access all interactive tools with complete data, all workload profiles, and the full scenario library.

Source Files

Downloadable source code, configuration files, and working examples from every chapter.

Lifetime Updates

Free updates for life. Every new chapter, tool, and improvement included.

Buy Now — $19 →
📦 Free sample included — download another copy for the full product.
File Watcher v1.0.0 — Free Preview