Re: Adding a File Modified Handler

new topic     » goto parent     » topic index » view thread      » older message » newer message
SDPringle said...

I would like my application to ask Windows to call a routine of mine when a specific file changes. I found a class that does that the problem is it is in the .NET framework. There is no C equivalent documented so I assume that doesn't exist. Is there another way to do the same thing using standard C calls so I can wrap that into EUPHORIA?

Shawn Pringle

The C API appears to be FindFirstChangeNotification() and ReadDirectoryChangesW() - however, this family of functions returns a handle that is meant to be used with WaitForSingleObject() or WaitForMultipleObjects(), so to simulate the asychronous notification you'll have to use a seperate thread that watches the handle and triggers your callback manually.

It's not possible to do this in Eu, but if you write a C dll to be called by Eu (so all the multithreaded handling is done in the dll by pure C code), then this should be fairly simple to do.

http://msdn.microsoft.com/en-us/library/aa365261(VS.85).aspx

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu