Question

We have created a .NET application using the FileSystemWatcher Class which raises an changed event once the content of the particular file has changed.

Now, we need to implement this application in VB6. Is there any way to check if contents of file have been changed in VB6?

I have read article and article2. But, it looks like they are watching all files within folder. I want to implement program that checks if contents of 1 .txt file has changed.

There is this FILE_NOTIFY_CHANGE_SIZE filter of ReadDirectoryChangesW API would do the trick? Even then, how do I hook it to 1 file (rather than entire directory)?

Is there any sample code reference for this.. I have worked on .NET but am very new to VB6...

Was it helpful?

Solution

There's a date stamp on the file, just check that. It's a bit arbitrary when it comes to idempotent writes - if you write a 0 over a 0, does that count as a write/change? But that's usually not a problem.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top