Could someone give me a minimal example of win32::changenotify code
that will raise multiple events for, e.g. mkdir -p a/b/c or mv foo/bar
baz? The following only catches one event, for instance:
require "win32/changenotify"
include Win32
$stdout.sync = true
cn = ChangeNotify.new("c:\\", true,
ChangeNotify::FILE_NAME |
ChangeNotify::DIR_NAME |
ChangeNotify::LAST_WRITE)
loop do
cn.wait(5) {|ss|
cn.reset
ss.each { |s|
puts "File: " + s.file_name
puts "Action: " + s.action
}
}
end
martin