- There is setTimer() which will send a message to the application message queue, but since Perl does not give you access to the dispatch loop, you cannot make use of this.
- There are also CreateWaitableTimer() which gives you a handle that can be passed along with the semaphore used by ChangeNotify, to the WaitForMultipleObjects() call that underlies the Win32::IPC wait() and wait_all() calls.
This would cause the wait to return if either a file changed, or if the timer went off.
But you would need to go through the hoops of using Win32::API to set up the waitable timer, and there is no guarentee that you could pass the resulting system object to the module and have it make use of it.
It is far simpler to just calculate the difference between the current time and the target wakeup time and use that as a timeout on your wait calls.
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
| [reply] |
alarm is a unix concept that doesn't exist in Windows. Perl attempts to emulate it, but there are limitations. I don't think it would be able to interrupt Win32::ChangeNotify, if that's what you're asking.
| [reply] |
Hi guys!
I have one more question on this:
How can i invoke ChangeNotify on multiple events? I tried using LAST_WRITE | SIZE - but it gave me an error! For me, LAST_WRITE almost takes care of all my issues but there's one event that i HAVE to take care of - 'file deletion' event! How do i achieve that? I should be notified when a file in a specific directory gets deleted by someone!
Thanks
| [reply] |
| [reply] [d/l] |
Thanks for the reply
.. and could you pls tell me how i can use both FILE_NAME and LAST_WRITE in the same ChangeNotify's wait()statement?
| [reply] |