class INotify::Event
which are passed to that watcher’s callback.
Each {Watcher} can fire many events,
An event caused by a change on the filesystem.
def self.consume(data, notifier)
-
(Event, nil)
- The event, or `nil` if the string is empty
Parameters:
-
notifier
(Notifier
) -- The {Notifier} that fired the event -
data
(String
) -- The string to be modified
Other tags:
- Private: -
def self.consume(data, notifier) return nil if data.empty? ev = new(data, notifier) data.replace data[ev.size..-1] ev end
def absolute_name
-
(String)
-
def absolute_name return watcher.path if name.empty? return File.join(watcher.path, name) end
def callback!
- Private: -
def callback! watcher.callback!(self) end
def flags
-
(Array
-)
def flags @flags ||= Native::Flags.from_mask(@native[:mask]) end
def initialize(data, notifier)
-
notifier
(Notifier
) -- The {Notifier} that fired the event -
data
(String
) -- The data string
Other tags:
- Private: -
def initialize(data, notifier) ptr = FFI::MemoryPointer.from_string(data) @native = Native::Event.new(ptr) @related = [] @cookie = @native[:cookie] @name = data[@native.size, @native[:len]].gsub(/\0+$/, '') @notifier = notifier @watcher_id = @native[:wd] raise Exception.new("inotify event queue has overflowed.") if @native[:mask] & Native::Flags::IN_Q_OVERFLOW != 0 end
def size
-
(Fixnum)
-
def size @native.size + @native[:len] end
def watcher
-
(Watcher)
-
def watcher @watcher ||= @notifier.watchers[@watcher_id] end