On 8 May 2011 05:37, Robert Bradshaw <rober...@math.washington.edu> wrote: > On Sat, May 7, 2011 at 6:45 AM, David Kirkby <drkir...@gmail.com> wrote: >> On 7 May 2011 10:59, Jeroen Demeyer <jdeme...@cage.ugent.be> wrote: >>> On 2011-05-06 19:53, Robert Bradshaw wrote: >>>> Even better would be to checksum the source in a src.md5 file, and >>>> have sage -spgk warn/error if the checksums don't match. >>> I think it is necessary and sufficient to checksum the output of "ls -lR". >> >> I would not rely on that, as a different UID or GID on different >> systems will give different results. > > As would touching a file (e.g. to revert a patch or accidental > change), or any change keeping the length of the file the same (yes, > small patches do that sometimes).
You raise an interesting point. My solution with cksum would not detect if the file has been touched whilst the contents remain the same, since its only checking the contents, not the date. But if someone has touched a file, but did not change the contents, it is not really an issue. >> MD5 would not be good, as different systems have either no program to >> compute an md5 checksum, or have them with different names. Although >> many systems have a "sum" command, the algorithm will be system >> dependant, so that too can't be used. >> >> In contrast, POSIX defines "cksum" so using that as a checksum tool is >> preferable. > > cksum is cryptographically weak, but strong enough for this purpose. Yes, there's a small probability of failure - I think 1 in 2^32, though perhaps thatÅ› not true. It was not designed for cryptographic purposes, but for just the sort of application being discussed here. I suspect md5 is more computationally intensive, but the real problem with md5 is there is no single command which will work on every system. Dave -- To post to this group, send an email to sage-devel@googlegroups.com To unsubscribe from this group, send an email to sage-devel+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-devel URL: http://www.sagemath.org