This post originated from an RSS feed registered with Ruby Buzz
by Daniel Berger.
Original Post: More on win32-changenotify
Feed Title: Testing 1,2,3...
Feed URL: http://djberg96.livejournal.com/data/rss
Feed Description: A blog on Ruby and other stuff.
Lo and behold, my Jeffrey Richter book "Advanced Windows, 3rd ed" had a section on ReadDirectoryChangesW(). It also explained how to setup a wait function on it. First, pass FILE_FLAG_OVERLAPPED to the CreateFile() call, then pass an OVERLAPPED structure to ReadDirectoryChangesW(). Then pass the hEvent OVERLAPPED struct member to WaitForSingleObject().
Works good, except now I need to back out some changes I committed. That's what I get for writing code before I've really thought things out. Shame on me.
I'm also beginning to wonder if allowing blocks to Ipc#new was a good idea. I think I should have limited it to Ipc#wait. Maybe not. We'll see.