c# - How to detect real-time change of text files? -


I have asked to write a small PC device to read log files using C # or Java. The log files will be in .txt format. An application is running and writing a log, and I want my device to open the logs at the same time and automatically refresh when a new line is written on the log file.

My challenge is, how do I identify log file changes, so that my device has the ability to display real time? This is a common question, but the pseudo code will be highly appreciated!

You can use FileSystemWatcher class () However be careful, If you try to open the file, while the other process is writing the file, then you will probably be denied Access.

Comments

Popular posts from this blog

Python SQLAlchemy:AttributeError: Neither 'Column' object nor 'Comparator' object has an attribute 'schema' -

java - How not to audit a join table and related entities using Hibernate Envers? -

mongodb - CakePHP paginator ignoring order, but only for certain values -