Skip to content

planety/fsnotify

Folders and files

NameName
Last commit message
Last commit date

Latest commit

725614b · Jul 8, 2024

History

39 Commits
Jul 8, 2024
Jul 8, 2024
Mar 27, 2022
Sep 4, 2020
Mar 27, 2022
Mar 28, 2022

Repository files navigation

fsnotify

A file system monitor in Nim

Supporting platform

Platform Watching Directory Watching File
Windows ReadDirectoryChangesW polling using os.getLastModificationTime and os.fileExists
Linux inotify polling using inotify and os.fileExists
Macos TODO(fsevents) polling using os.getLastModificationTime and os.fileExists
BSD Not implemented TODO(kqueue)

Hello, world

import std/os
import fsnotify


proc hello(event: seq[PathEvent]) =
  echo "Hello: "
  echo event

var watcher = initWatcher()
register(watcher, "/root/play", hello)

while true:
  sleep(500)
  process(watcher)