watch_for_files

cross-platform file watcher with database

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

Summary

Latest Version Unknown
License MIT
CI Status Failing
Downloads 0
Last Indexed 2026-07-21 05:25

Installation

nimble install watch_for_files
choosenim install watch_for_files
git clone https://github.com/hamidb80/watch_for_files

OS Compatibility

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

Source

Repository https://github.com/hamidb80/watch_for_files
Homepage https://github.com/hamidb80/watch_for_files
Registry Source nimble_official

README

About

this is a cross-platform file watcher with database it means you can save into DB the lastest files modification times this special feature allows you to avoid unnecessary operations

How To use

let's take a look at the defination of the main proc goWatch

proc goWatch*(
  folder: string, 
  tunnel: ptr Channel[ChangeFeed], 
  active: ptr bool,
  timeInterval: int, 
  dbPath: string = "", 
  save: bool = false
)
  • folder: path to folder you wanna watch files changes, the program will watch file changes in any depths in that folder
  • tunnel: a ptr to channel: changes will be sent to this channel
  • active: a ptr to a bool: determines whether the worker [the file watcher] should continue to work or not
  • timeInterval: the delay between every check
  • dbPath: the database path
  • save: a boolean that indicates whether the files modifications state should be saved after every check or not

Note: if you specify dbPath and the file exists there, the saved state is going to be restored before the first check


the changes that will be sent to the channel are tuples of path & change_kind

  ChangeFeedVariants* = enum
    CFCreate, CFEdit, CFDelete

  ChangeFeed* = tuple
    path: string
    kind: ChangeFeedVariants

you can find the example of usage in tests/test.nim