Parent

EventMachine::FileWatcher

This is subclassed from EventMachine::Connection for use with the file monitoring API. Read the documentation on the instance methods of this class, and for a full explanation see EventMachine.watch.

Public Instance Methods

file_deleted() click to toggle source

Should be redefined with the user’s custom callback that will be fired when the file is deleted. When the file is deleted, stop_watching will be called after this to make sure everything is cleaned up correctly.

Note that on linux (with inotify), file_deleted will not be called until all open file descriptors to the file have been closed.

    # File lib/em/filewatcher.rb, line 35
35:     def file_deleted
36:     end
file_modified() click to toggle source

Should be redefined with the user’s custom callback that will be fired when the file is modified.

    # File lib/em/filewatcher.rb, line 26
26:     def file_modified
27:     end
file_moved() click to toggle source

Should be redefined with the user’s custom callback that will be fired when the file is moved or renamed.

    # File lib/em/filewatcher.rb, line 39
39:     def file_moved
40:     end
path() click to toggle source

Returns the path that EventMachine::watch was originally called with. The current implementation does not pick up on the new filename after a rename occurs.

    # File lib/em/filewatcher.rb, line 21
21:     def path
22:       @path
23:     end
stop_watching() click to toggle source

Discontinue monitoring of the file. This involves cleaning up the underlying monitoring details with kqueue/inotify, and in turn firing unbind. This will be called automatically when a file is deleted. User code may call it as well.

    # File lib/em/filewatcher.rb, line 45
45:     def stop_watching
46:       EventMachine::unwatch_file(@signature)
47:     end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.