tazim
tazim

Reputation: 615

determining file changes in python

I have a text file being written by another process on a server which I want to watch for changes. Each time a change occurs I'd like to read the new data and send it to client . Any suggestions will be valuable . Using Django,Python

Tazim.

Upvotes: 0

Views: 372

Answers (2)

Jacek Konieczny
Jacek Konieczny

Reputation: 8614

On Linux a convenient interface for file modification monitoring is Gamin the File Alteration Monitor. Python bindings are provided and they are really easy to use, though they could be documented better (especially the 'magic numbers' returned).

Upvotes: 0

Klaas van Schelven
Klaas van Schelven

Reputation: 2538

If you're using a recent Linux you should look into this:

http://trac.dbzteam.org/pyinotify

How do I watch a file for changes? goes into details for win32

Upvotes: 2

Related Questions