Monitoring contents of files/directories?

I’m looking for a cross-platform file monitoring python package? I know it is possible to monitor files on windows using pywin32, and there are packages working on Linux/Unix but does anyone know about a cross-platform one? Answers: Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help … Read more

Read from a log file as it’s being written using python

I’m trying to find a nice way to read a log file in real time using python. I’d like to process lines from a log file one at a time as it is written. Somehow I need to keep trying to read the file until it is created and then continue to process lines until I terminate the process. Is there an appropriate way to do this? Thanks.

How can I monitor disk I/O in a particular directory?

I’ve got a few processes with a known name that all write to files in a single directory. I’d like to log the number of disk block reads and writes over a period (not just file access) to test whether a parameter change reduces the amount of I/O significantly. I’m currently using iostat -d -p, but that is limited to the whole partition.