Description
A class for monitoring directories on MS Windows.
Installation
gem install win32-dirmonitor
Synopsis
require 'win32/dirmonitor'
include Win32
# Wait for a change in your home directory and report any changes.
monitor = Win32::DirMonitor.new(ENV['HOME'])
# Wait up to 5 minutes for a change.
monitor.wait(300){ |struct|
puts 'Something changed'
puts 'File: ' + struct.file
puts 'Action: ' + struct.action
struct.changes.each do |change|
puts "Change: " + change[0].to_s
puts "Old: " + change[1].to_s
puts "New: " + change[2].to_s
end
}
Notes
This replaces the win32-changejournal library and supplants the
win32-changenotify library since it gives details about the changes
that occur.
Future Plans
Allow files in subdirectories to be monitored as well.
Known Bugs
None that I know of. Please log any bug reports on the RubyForge
project page at https://github.com/djberg96/win32-dirmonitor.
License
Artistic 2.0
Copyright
(C) 2014 Daniel J. Berger, All Rights Reserved
Warranty
This library is provided "as is" and without any express or
implied warranties, including, without limitation, the implied
warranties of merchantability and fitness for a particular purpose.
Authors
* Daniel J. Berger
* Park Heesob