module INotify::Native::Flags
A module containing all the inotify flags to be passed to {Notifier#watch}.
@private
Constants
- IN_ACCESS
File was accessed.
- IN_ALL_EVENTS
All events which a program can wait on.
- IN_ATTRIB
Metadata changed.
- IN_CLOSE
Close.
- IN_CLOSE_NOWRITE
Unwrittable file closed.
- IN_CLOSE_WRITE
Writtable file was closed.
- IN_CREATE
Subfile was created.
- IN_DELETE
Subfile was deleted.
- IN_DELETE_SELF
Self was deleted.
- IN_DONT_FOLLOW
Do not follow a sym link.
- IN_IGNORED
File was ignored.
- IN_ISDIR
Event
occurred against dir.- IN_MASK_ADD
Add to the mask of an already existing watch.
- IN_MODIFY
File was modified.
- IN_MOVE
Moves.
- IN_MOVED_FROM
File was moved from X.
- IN_MOVED_TO
File was moved to Y.
- IN_MOVE_SELF
Self was moved.
- IN_ONESHOT
Only send event once.
- IN_ONLYDIR
Only watch the path if it is a directory.
- IN_OPEN
File was opened.
- IN_Q_OVERFLOW
Event
queued overflowed.- IN_UNMOUNT
Backing fs was unmounted.
- PC_NAME_MAX
returns the maximum length of a filename in the directory path or fd that the process is allowed to create. The corresponding macro is _POSIX_NAME_MAX.
Public Class Methods
Converts a bitmask from the C API into a list of flags.
@param mask [Fixnum] @return [Array<Symbol>]
# File lib/rb-inotify/native/flags.rb, line 86 def self.from_mask(mask) constants.map {|c| c.to_s}.select do |c| next false unless c =~ /^IN_/ const_get(c) & mask != 0 end.map {|c| c.sub("IN_", "").downcase.to_sym} - [:all_events] end
Converts a list of flags to the bitmask that the C API expects.
@param flags [Array<Symbol>] @return [Fixnum]
# File lib/rb-inotify/native/flags.rb, line 77 def self.to_mask(flags) flags.map {|flag| const_get("IN_#{flag.to_s.upcase}")}. inject(0) {|mask, flag| mask | flag} end