class

Inotify::Watcher

Inherits Reference / Object

Constructors

new(recursive : Bool = false)

Creates a new inotify instance and starts reading from the event queue. Optional: Set recursive to true to automatically watch all new subdirectories.

Source

Instance methods

clear_event_handlers

Removes all event handlers added with #on_event.

Source
close

Closes file descriptor referring to the inotify instance.

Source
finalize
Source
on_event

Attach a &block to the instance, this will receive all events.

Source
unwatch(path : String)

Removes an item from an inotify watch list based on its path. Returns true on success. NOTE: path is case sensitive and has to be an exact match, to what was passed into #watch.

Source
unwatch(wd : LibC::Int)

Removes an item from an inotify watch list based on its watch descriptor wd. Returns true on success, otherwise raises.

Source
watch(path : String, mask = DEFAULT_WATCH_FLAG)

Adds a new watch, or modifies an existing watch, for the path specified. Optional: The events to be monitored can be specified in the mask bit-mask argument.

Source
watching

Returns all paths that are currently being watched.

Source