开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜