Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
372 views
in Technique[技术] by (71.8m points)

.net - How reliable is the FileSystemWatcher in .netFramwork 4?

Has anyone used the FileSystemWatcher in framework 4 and have you encountered any problems?

i am using it in a windows service and i cant afford for it to fail.

I have heard from a friend that it is not very reliable but I have been testing for a few hours now and i havent had any problems but i am still doubting using it.....

i would appreciate any advice on this matter, i dont want to deliver the app to the the client and then realise that this thing is going to crash....

Thanks


Thanks for the advice guys

i think for my purposes it should be ok. it will be checking a folder on the local drive of the server and all its checking for is if a file have been modified so i think it should be fine

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

FileSystemWatcher relies on underlying file system support, so any reliability issues with the file system will be visible as reliability issues with FileSystemWatcher. For example, if you are watching a network directory, then the network server's reliability will affect FileSystemWatcher's reliability. For example, the server may crash and be restarted. You will not be notified of changes that take place while network connectivity is lost. Or the server may simply have a bug that prevents FileSystemWatcher from working reliably.

Another point is that FileSystemWatcher only watches for changes to metadata. Not all file changes result in changes to metadata.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...