← Back to all sparks
W

watcher

INFRA · APIS
Velocity0.0

Watch the File System for Changes. Contribute to r-lib/watcher development by creating an account on GitHub.

watcher is a thin filesystem-events binding whose releases are mostly build work.

filesystem-eventsr6build-portabilityc-bindingslibfswatch
Current state
The package wraps libfswatch in an R6 Watcher class for monitoring files and directories. Seven releases over sixteen months have added a vector path argument and two accessor methods, and spent the rest of their effort on build portability — non-standard system library locations, Windows bi-arch source builds on old rtools, and most recently removing the cmake requirement so the bundled source compiles with the R toolchain alone.
Where it's heading
The API is deliberately small and appears finished; the work that remains is making the C dependency install cleanly everywhere. Dropping cmake follows the same move nanonext made, which is not a coincidence — both come from the same author and both are aiming at environments where installing a build system is not an option.
Prediction
With cmake gone and the bundled library current, further releases are most likely to track libfswatch upstream rather than extend the R interface.

Recent moves

  1. 1mo ago

    cmake dropped from the bundled library build

    Building the bundled libfswatch no longer requires cmake — the R C/C++ toolchain is used directly, with a system library still preferred when present. It removes the main obstacle to installing on machines without a build system.

    View source ↗
  2. 3mo ago

    Bundled libfswatch updated to 1.20.1

    Updates the bundled libfswatch source to the 1.20.1 release. No interface change.

    View source ↗
  3. 8mo ago

    Windows CPU usage fix for sub-second latency

    Fixes high CPU usage on Windows when watching with a latency below one second.

    View source ↗
  4. 1y ago

    System libfswatch found in non-standard locations

    Allows a system libfswatch installed in a non-standard location to be used. One more step in the build-portability sequence.

    View source ↗
  5. 1y ago

    Multiple paths per watcher, and older Windows builds fixed

    watcher() accepts a vector for the path argument so several files or directories can be monitored at once, and Windows bi-arch source builds work again on rtools40 and earlier.

    View source ↗
  6. 1y ago

    Accessor methods replace public Watcher fields

    Adds $get_path() and $is_running() methods and makes the corresponding fields private — a small API tightening that breaks direct field access.

    View source ↗