user158182
user158182

Reputation: 97

events in a file system watcher

when i use a file system watcher changed event for a notepad it occurs once,but the event occurs twice for a word pad,please give me the reason.i launch using explorer

A bit Briefly, I have a file named "xxx.log" it contains some strings,i wrote a filesystemwatcher which will watch this file for size(notifyfilter - size) changed.whenever i opened the file with notepad the changedevent occurs once,whenevr i do it with wordpad the event occurs twice what is the reason. i open files using explorer.exe.

how to handle this problem.i need the event once only,is there any way

Upvotes: 1

Views: 442

Answers (2)

Nick Randell
Nick Randell

Reputation: 18315

The best way to understand this is to use process monitor from sysinternals. This will show you exactly what is going on.

Upvotes: 0

weismat
weismat

Reputation: 7411

I think that notepad has no lock/backup file handling. Thus it writes only once to the file - Word and Wordpad work with some temporary files for backup and locking purposes and for that reason they might write twice.

Upvotes: 1

Related Questions