Same file?

Richard Gaskin ambassador at fourthworld.com
Fri Apr 16 18:37:15 EDT 2010


Andre wrote:

> put the md5digest of url ("binfile:" & path1) into tMD5file1
> put the md5digest of url ("binfile:" & path2) into tMD5file2
> if tMD5file1 is tMD5file2 then
>   return true
> else
>   return false
> end if

Andre, you've been programming too deeply for too long. :)

MD5digest is great for storing small signatures of large files, but 
since the function reads the full file contents it can simply use:

   if url ("binfile:"& path1) is url ("binfile:"& path2) then
   ...

You're not alone:  this morning I caught myself writing 20 beautifully 
complex lines to do something that later occurred to me could be done in 
a single line that was much easier to read. :)

The seductive beauty of RevTalk....

--
  Richard Gaskin
  Fourth World
  Rev training and consulting: http://www.fourthworld.com
  Webzine for Rev developers: http://www.revjournal.com
  revJournal blog: http://revjournal.com/blog.irv



More information about the use-livecode mailing list