Skip to content

adamhooper/rinotify

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

49 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Example usage:

rinotify = RInotify.new
rinotify.add_watch(ARGV[0], RInotify::MODIFY | RInotify::DELETE_SELF)

has_events = rinotify.wait_for_events(5)  
if has_events
  # iterate through events
  rinotify.each_event {|revent|

    # check if the event we received was MODIFY or DELETE_SELF
    if revent.check_mask(RInotify::MODIFY)
      puts "file was modified"
    elsif revent.check_mask(RInotify::DELETE_SELF)
      puts "file was deleted"
    end
  }

else
  # no events were received in the number of seconds specified in wait_for_events above
  puts "Timed out"
end

# close and clean up
rinotify.close

About

github fork of RInotify: A Ruby wrapper for Linux's inotify (by Rob Merrell)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors