File Polling (Rereading)

Miki Tebeka miki.tebeka at zoran.com
Thu Oct 21 15:42:52 CEST 2004


Hello Diez,

> > Good to hear! i only need the changes! do you have code examples?
> 
> This is a misunderstanding: I didn't mean "the changes". What you can get by
> calling
> 
> os.stat
> 
> is the timestamp of the last modification - so you can then skip rereading
> the file if there has been no modification after the last time you read the
> file.
After that you can compare md5 hashes (which are fast to compute) and know if
the file content has changed.

> But you _can't_ only read what has been changed in the file - there is no
> such thing neither in python, nor the underlying OSses (which is the reason
> for python not having such a functionality)
IMO it is possible (don't know exactly how) on journalized file systems.

Bye.
--
------------------------------------------------------------------------
Miki Tebeka <miki.tebeka at gmail.com>
http://tebeka.spymac.net
The only difference between children and adults is the price of the toys



More information about the Python-list mailing list