From: Dale Martenson Date: 2002-03-28T00:09:38+09:00 Subject: RE: File change notification? Hello, Nobu Nakada wrote: >> # Wait for notification. >> >> dwWaitStatus = k32WaitForMultipleObjects.Call(2, lp_dwChangeHandles, >> 0, INFINITE) > >Note that this call blocks all threads completely. You are correct. It would be better to specify a timeout on the WaitForMultipleObjects call. You could do something like: # Add a constant for the timeout return value WAIT_TIMEOUT = 0x00000102 # . . . inside the while-loop # Change the wait to have a timeout. In this case, 2 seconds. dwWaitStatus = k32WaitForMultipleObjects.Call(2, lp_dwChangeHandles, 0, 2000 ) # If desired, modify the case-statement to act on the timeout condition when WAIT_TIMEOUT print "#{Time.now}: Nothing happened yet\n" -- Dale