GitHunt

libfswatch wrapper

Cross-platform filesystem event monitor for Nim.

Wraps the https://github.com/emcrisostomo/fswatch[libfswatch] library.

image:https://img.shields.io/badge/status-alpha-orange.svg[badge]
image:https://img.shields.io/badge/Nim%20version-0.19.0+-green.svg[Nim version]
image:https://img.shields.io/github/tag/FedericoCeratto/nim-fswatch.svg[tags]
image:https://img.shields.io/badge/License-GPL%20v3-blue.svg[License]

Usage

[source,bash]

sudo apt-get install libfswatch11
nimble install fswatch

[source,nim]

import times, fswatch

var monitor = newMonitor(latency=0.01)
monitor.add("my-file-path")

proc callback(eg: EventGroup) =
for e in eg:
echo e.path, " ", $e.kind, " ", e.time.utc()

monitor.setCallback(callback)

blocks here

monitor.start()

Contributing

Testing and PRs are welcome.

Languages

Nim100.0%

Contributors

GNU General Public License v3.0
Created April 3, 2019
Updated December 18, 2025