[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

win32::changenotify and multiple events

Martin DeMello

2/28/2007 12:09:00 PM

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