Sergei G
Sergei G

Reputation: 1570

monitor file changes in c++ (windows)

I have a set of files and I would like to monitor them for changes.
I have tried FileSystemWatcher class, but it seems notifications are fired after file is changed and then saved. Say, if I monitor directory for changes in .txt files, open some file, save it FileSystemWatcher works. But how can I monitor changes when the file is opened and something is typed without saving? Reading original first and then reading the same file after some interval and then comparing them seems slow and stupid. Is there a nice way to monitor such situation?

Upvotes: 0

Views: 1502

Answers (2)

ext
ext

Reputation: 2903

No, if you read a file into memory and modifies it, how would another application know about it?

Upvotes: 3

user325117
user325117

Reputation:

No, because the file itself hasn't changed yet.

Upvotes: 6

Related Questions