The Artima Developer Community
Sponsored Link

Ruby Buzz Forum
win32-changenotify 0.3.0 released

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Daniel Berger

Posts: 1383
Nickname: djberg96
Registered: Sep, 2004

Daniel Berger is a Ruby Programmer who also dabbles in C and Perl
win32-changenotify 0.3.0 released Posted: Jan 27, 2005 11:31 PM
Reply to this message Reply

This post originated from an RSS feed registered with Ruby Buzz by Daniel Berger.
Original Post: win32-changenotify 0.3.0 released
Feed Title: Testing 1,2,3...
Feed URL: http://djberg96.livejournal.com/data/rss
Feed Description: A blog on Ruby and other stuff.
Latest Ruby Buzz Posts
Latest Ruby Buzz Posts by Daniel Berger
Latest Posts From Testing 1,2,3...

Advertisement
I *finally* released win32-changenotify 0.3.0 today. I had to disallow blocks to the constructor due to the asynchronous nature of the code I used. Well, I didn't have to, but I had to alter it in one of two ways. I chose what I believed to be the more strict option.

Anyway, here's a Ruby code snippet for you to enjoy. This notifies you of any file name changes, or writes to any existing files:
require "win32/changenotify"
include Win32

filter = ChangeNotify::FILE_NAME | ChangeNotify::LAST_WRITE

cn = ChangeNotify.new("C:\\",false,filter)

# Wait up to 5 minutes for a change
cn.wait(300){ |cn_struct|
   puts "Something changed"
   puts "File:   " + cn_struct.file_name
   puts "Action: " + cn_struct.action
}


I know the Perl version can't do this. I'm pretty sure the Python version can't either (but it's been a while since I looked).

Read: win32-changenotify 0.3.0 released

Topic: dgwebfree Previous Topic   Next Topic Topic: CD Baby & 90k lines of PHP going rails

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use