class EventMachine::FileWatch

@see EventMachine.watch_file
@note On Mac OS X, file watching only works when kqueue is enabled
* File is moved
* File is deleted
* File is modified
Utility class that is useful for file monitoring. Supported events are

def file_deleted

Other tags:
    Abstract: -

Other tags:
    Note: - On Linux (with {http://en.wikipedia.org/wiki/Inotify inotify}), this method will not be called until *all* open file descriptors to
def file_deleted
end

def file_modified

Other tags:
    Abstract: -
def file_modified
end

def file_moved

Other tags:
    Abstract: -
def file_moved
end

def path

Other tags:
    See: EventMachine.watch_file -

Returns:
  • (String) -

Other tags:
    Note: - Current implementation does not pick up on the new filename after a rename occurs.
def path
  @path
end

def receive_data(data)

Other tags:
    Private: -
def receive_data(data)
  case data
  when Cmodified
    file_modified
  when Cdeleted
    file_deleted
  when Cmoved
    file_moved
  end
end

def stop_watching

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

Discontinue monitoring of the file.
def stop_watching
  EventMachine::unwatch_filename(@signature)
end # stop_watching