From: nkb Date: 2004-10-11T19:15:35+09:00 Subject: Did anyone get DirectoryWatch working? Hi. I placed the following codes at the bottom of the file DirectoryWatch.rb and ran it from my command line in WindowsXp. Nothing seems to be happening even when I change/add/modify files. What am I missing? Thanks. device_manager = Dir::DirectoryWatcher.new( 'c:/temp', 2 ) device_manager.name_regexp = /^[^.].*\.rb$/ device_manager.on_add = Proc.new{ |the_file, stats_hash| puts "Hey, just found #{the_file.inspect}!" # Store something custom stats_hash[:blorgle] = the_file.foo } device_manager.on_modify = Proc.new{ |the_file, stats_hash| puts "Hey, #{the_file.inspect} just changed." } device_manager.on_remove = Proc.new{ |stats_hash| puts "Whoa, the following file just disappeared:" stats_hash.each_pair{ |k,v| puts "#{k} : #{v}" } } device_manager.start_watching()