Park Heesob wrote:
> It's a feature of ChangeNotify.
> You could filter duplicate event like this:
> 
> filter = ChangeNotify::FILE_NAME | ChangeNotify::DIR_NAME | ChangeNotify::LAST_WRITE
> abs_path = File.expand_path(dir)
> pre_event = nil
> ChangeNotify.new(abs_path, true, filter) do |cn|
>    cn.wait do |events|
>      events.each do |event| 
>        next if [event.action,event.file_name] == pre_event
>        pre_event = [event.action,event.file_name]
>        puts(event.action, event.file_name)
>      end
>    end
> end

And what if I modify same file two times in a row? I could count events, 
as there are 4 for modification. Wouldn't it be better to use 
changejournal and filter in only "close" actions?

--
Oinopion
http://hauru.eu