Skip to content

FedericoCeratto/nim-fswatch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

libfswatch wrapper

Cross-platform filesystem event monitor for Nim.

Wraps the libfswatch library.

badge Nim version tags License

Usage

sudo apt-get install libfswatch11
nimble install fswatch
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.