Change on file

F

Fulvio

***********************
Your mail has been scanned by InterScan MSS.
***********************


Hello,

I was thinking about use md5 check to se if a file had changes since last
check. Am I correct?
Is there any other light method?

F
 
S

Sybren Stuvel

Fulvio enlightened us with:
I was thinking about use md5 check to se if a file had changes since
last check. Am I correct?

You can do that, but a check on the mtime (os.stat) would be a lot
easier.

Sybren
 
M

Marshall

You could use ctime to see it by the time.

MD5 it's a most secure way to a file that CAN'T be modified. If you
just want to see if the file has been modified (like to make a cache),
use ctime.
 
A

Alan Franzoni

Il Tue, 24 Oct 2006 19:47:43 +0800, Fulvio ha scritto:
Hello,

I was thinking about use md5 check to se if a file had changes since last
check. Am I correct?
Is there any other light method?

It's OK, but if you have a lot of files to check and they're large, and
changes frequent, it could put the system under severe workload.

If you just need to know if a file has changed, you can check via
date/time, or if you don't trust somebody who's got access to it (because
he could have manually altered the datetime) you could go for a simpler
algorithm, like sfv.

--
Alan Franzoni <[email protected]>
-
Togli .xyz dalla mia email per contattarmi.
Remove .xyz from my address in order to contact me.
-
GPG Key Fingerprint (Key ID = FE068F3E):
5C77 9DC3 BD5B 3A28 E7BC 921A 0255 42AA FE06 8F3E
 
F

Fulvio

***********************
Your mail has been scanned by InterScan MSS.
***********************


it could put the system under severe workload.

Thank you for the enlightment :)
In my case it's meant to check a couple of files, but no more than 10 Mbytes.
The most purpose is to find differences since last check. I suppose it's a
good way, as other programs using CRC as comparison between file, better than
byte-to-byte diff. Also CD images and big files download are giving a MD5
check.
My point stand as platform indipendent solution and won't take extra fancy
modules which aren't part of python package itself. I'll look at SVF and
timestamp options. I'm less actracted by the idea of 'stat' on the file, Now
I'm on linux and I've some doubt about win32 options.

PS. C'e' la MList per iclp?

F
 
B

Ben Finney

Fulvio said:
***********************
Your mail has been scanned by InterScan MSS.
***********************

Fulvio, something between your fingers and the Python mailing list is
causing this to appear at on *every* message you send to this list.

Please do whatever you need to do to make it stop. It's unwelcome and
obnoxious.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,999
Messages
2,570,243
Members
46,838
Latest member
KandiceChi

Latest Threads

Top