Class | FChange::Notifier |
In: |
lib/vendor/windows/lib/rb-fchange/notifier.rb
|
Parent: | Object |
Notifier wraps a single instance of FChange. It‘s possible to have more than one instance, but usually unnecessary.
@example
# Create the notifier notifier = FChange::Notifier.new # Run this callback whenever the file path/to/foo.txt is read notifier.watch("path/to/foo/", :all_events) do puts "foo was accessed!" end # Nothing happens until you run the notifier! notifier.run
INFINITE | = | 0xFFFFFFFF | ||
WAIT_OBJECT_0 | = | 0x00000000 |
Blocks until there are one or more filesystem events that this notifier has watchers registered for. Once there are events, the appropriate callbacks are called and this function returns.
@see run
Blocks until there are one or more filesystem events that this notifier has watchers registered for. Once there are events, returns their {Event} objects.
@private
Stop watching for filesystem events. That is, if we‘re in a \{run} loop, exit out as soon as we finish handling the events.
Watches a file or directory for changes, calling the callback when there are. This is only activated once \{process} or \{run} is called.
**Note that by default, this does not recursively watch subdirectories of the watched directory**. To do so, use the `:recursive` flag.
`:recursive` : Recursively watch any subdirectories that are created.
@param path [String] The path to the file or directory @param flags [Array<Symbol>] Which events to watch for @yield [event] A block that will be called
whenever one of the specified events occur
@yieldparam event [Event] The Event object containing information
about the event that occured
@return [Watcher] A Watcher set up to watch this path for these events @raise [SystemCallError] if the file or directory can‘t be watched,
e.g. if the file isn't found, read access is denied, or the flags don't contain any events