filesystemwatcher and read from file

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have an app which will continuously write to a file, appending data. I need
to be notified of that write and be able to read from it starting off at
where the appended data begins.
I know how to get the notifications using the filesystemwatcher(although the
onchanged event for a file update is triggered twice and I need to figure out
how to turn off the second hit or identify it as redundant)

What is the best way of returning to the file once I am notified it has
changed and reading the appended data only back(possibly to another file)?

How should I open these files permission wise?

Thanks
 
Sounds like you want to 'tail' the file. This is a system utility in
Unix, and it comes on every Unix system I've used. You probably didn't
know this, but when I searched on Google for "C# tail" this was the
first result, and exactly what you are looking for:

http://www.codeproject.com/csharp/WinTail.asp

Hope this helps.

jeremiah
 
Hi emanl,

Does the article jeremiah provided meet your need? If you have any concern,
please feel free to tell me, thanks.

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 
Back
Top