FileSystemWatcher Issue
I have a windows service which has a FileSystemWatcher
which watch a log folder for txtfiles changes.
it fires onChanged
Event every time a logline gets written to a txtfile , i start reading for that file and i retrieve that line and then process it som开发者_Python百科e way, the problem is :
the events doesnt get fired unless :
-i open the folder with windows explorer -i keep pressing refresh (f5)
if i dont do that the events doesnt get fired !
Sometimes this might happen when the internal buffer of the file is not flushed. Try flushing the stream after you write to it.
精彩评论