Check if file is overwritten

Larry Bates lbates at swamisoft.com
Mon Jun 21 22:09:11 CEST 2004


When you open file, get last modified date
using os.path.getmtime() and set it aside.
When you are done with the file, get the
os.path.getmtime() again again, if it has
changed you will know it.

HTH,
Larry Bates
Syscon, Inc.

"Esben Skov Pedersen" <spam at geek.linux.dk> wrote in message
news:Xns950FDFB6A260Aspamatgeeklinuxdk at 130.225.247.90...
> How do i check if a file is overwritten by another program, while my
script
> is running?
>
> I have to monitor changes and act on them on the fly.
>
> It only has to work on windows, so perhaps it is possible to set op a hook
> to the system. I saw that done on a folder at one time, but i can't find
> the example now.
>
> I would rather that it uses a minimum of CPU, since the program always
will
> be running. Does anybody know the solution?
>
> /Esben





More information about the Python-list mailing list