469,271 Members | 895 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,271 developers. It's quick & easy.

Change on file

***********************
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

Oct 24 '06 #1
5 1032
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
--
Sybren Stüvel
Stüvel IT - http://www.stuvel.eu/
Oct 24 '06 #2
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.

Oct 24 '06 #3
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 <al***************@gmail.com>
-
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
Oct 24 '06 #4
***********************
Your mail has been scanned by InterScan MSS.
***********************
On Tuesday 24 October 2006 20:22, Alan Franzoni wrote:
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
Oct 25 '06 #5
Fulvio <fu****@tm.net.mywrites:
***********************
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.

--
\ "In prayer, it is better to have a heart without words than |
`\ words without heart." -- Mahatma Gandhi |
_o__) |
Ben Finney

Oct 25 '06 #6

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Max | last post: by
2 posts views Thread by david | last post: by
2 posts views Thread by Joel D Kraft | last post: by
8 posts views Thread by miladhatam | last post: by
27 posts views Thread by Jon Slaughter | last post: by
1 post views Thread by PSiegmann | last post: by
reply views Thread by Michael Bray | last post: by
1 post views Thread by CARIGAR | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.