Hey!
I'm working with win32-changenofity library to listen for any changes in a directory. I'm interested in added, deleted and modified files. That's my code:
···
#-------
filter = ChangeNotify::FILE_NAME | ChangeNotify::DIR_NAME
abs_path = File.expand_path(dir)
ChangeNotify.new(abs_path, true, filter) do |cn|
cn.wait do |events|
events.each do |event|
puts(event.action, event.file_name)
end
end
end
#--------
The problem is when I modify file on disk, it's not reported. When I use additional filters like SIZE or LAST_WRITE I get changes reported few times. Is there some combination which will report file change only once?
--
Oinopion
http://hauru.eu