win32::changenotify and multiple events

M

Martin DeMello

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top