[ANN] win32-changejournal 0.1.0

Hi all,

The Win32 Utils team is happy to announce the first release of
win32-changejournal.

What is it?

···

===========
This is a Ruby interface for Windows change journals. A Change Journal
is a file based account of all changes to files and directories on the
NTFS file system. So long as you have an NTFS filesystem, this package
should be preferred over win32-changenotify.

Synopsis

require "win32/changejournal"
include Win32

# Indefinitely wait for a change in 'C:\' and any of its
# subdirectories. Print the file and action affected.

cj = ChangeJournal.new('C:\')
cj.wait{ |info|
   p info.file_name
   p info.action
}

Where is it?

It can be found on the RAA (as win32-cjournal) or on the Rubyforge
project page at http://www.rubyforge.org/projects/win32utils (where you
can also get a binary, if you prefer).

Many thanks go to Park Heesob for this release.

Regards,

The Win32 Utils Team

For more about Change Journals:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/fileio/base/change_journals.asp

Okay, so I finally got around to trying this out. Sorry about the delay.
I'm facing some problems.

Code:
---------------->8-------------------------------
require 'win32/changenotify'
require 'win32/changejournal'

include Win32

watch_path = 'C:\Some\Long\Path\\'

#watch = ChangeNotify.new(watch_path,true,ChangeNotify::LAST_WRITE)
watch = ChangeJournal.new(watch_path)

puts "Starting watch.."

watch.wait do|info|
  puts "Change Detected:"
  puts "File:#{info.file_name}"
  puts "Action:#{ info.action}"
  $stdout.flush
end while true
------------------------8<-----------------------

Firstly, if there is something really bad I'm doing in this code, do
point it out.
What I'm observing is this:
With ChangeJournal, when I run this, I get notifications for changes
of files that are NOT under the specified directory. Another problem
is that it takes around ten seconds(or more sometimes) for it to start
noticing changes, especially if I Ctrl+C a running instance of the
program and start it again. Stuff works as expected with ChangeNotify.

I'm on WinXP Professional.
ruby -v gives
ruby 1.8.2 (2004-11-06) [i386-mswin32]

Thanks
CT