dmon

Library to monitor file changes in a folder. A port of Dmon.

Pure Nim score 15/100 · tests present · no docs generated

Summary

Latest Version 0.5.2
License BSD-2-Clause
CI Status Failing
Downloads 0
Last Indexed 2026-11-21 14:03

Authors

  • Jaremy Creechley

Installation

nimble install dmon
choosenim install dmon
git clone https://github.com/elcritch/dmon-nim

OS Compatibility

Platform Linux macOS Windows FreeBSD OpenBSD NetBSD Android iOS WASM Embedded
dmon ✓ ✓ ✓ ✓ ✓ ✓ - - - -

Dependencies

Package Version Optional
nim >= 2.0 No
macosutils >= 0.3.2 No
winim >= 3.9.4 No
chroniclers >= 0.2.0 No
chronicles >= 0.10.0 No

Source

Repository https://github.com/elcritch/dmon-nim
Homepage https://github.com/elcritch/dmon-nim
Registry Source nimble_official

README

Dmon

Monitor file changes in directories. Supports recursive file monitoring!

This is an idiomatic Nim port of the C library dmon by @septag.

Status

Platform support: - [x] MacOS - [x] Linux - [x] FreeBSD - [x] OpenBSD - [x] NetBSD - [~] Windows - compiles with wine but untested

Watch capacity

The default limit is 64 simultaneous watches per process, shared by all callers. Set the limit when compiling your application:

nim c -d:dmonMaxWatches=256 app.nim

The exported dmonMaxWatches constant reports the configured capacity. Values must be positive and fit in a WatchId. macOS, Linux, and BSD allow larger capacities; Windows supports at most 64 because its backend uses WaitForMultipleObjects. Unsupported values fail at compile time.

Registering a watch when every slot is occupied raises ValueError. Releasing a watch makes its slot available immediately. Increasing this limit does not change operating-system resource limits or recursive-watch behavior.

Watch callbacks run on the monitor thread and may run while the watcher lock is held. Queue registration and removal back to your application thread rather than calling watch lifecycle functions from a callback.