Win32::changenotify and multiple events

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 =“c:\”, true,
ChangeNotify::FILE_NAME |
ChangeNotify::DIR_NAME |

loop do
cn.wait(5) {|ss|
ss.each { |s|
puts "File: " + s.file_name
puts "Action: " + s.action


This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs