All I/O calls are best followed by error-checking (things can go wrong for many reasons):Ledigimate wrote: ↑Thu Dec 13, 2018 7:13 pmUpdate: The problem where I get the same result on two different files occur only when the file size exeeds 504 MB.
When the file size exceeds 504 MB, tData is empty. I don't know if this is due to a limitation in LiveCode, or due to insufficient memory.Code: Select all
function fileMd5Digest pFilePath local tCheckSum local tData put url ("binfile:" & pFilePath) into tData get binarydecode("H*", md5digest(tData), tCheckSum) return tCheckSum end fileMd5Digest
Code: Select all
function fileMd5Digest pFilePath
local tCheckSum
local tData
put url ("binfile:" & pFilePath) into tData
if the result is not empty then
answer "Couldn't read file ""e& pFilePath &": "& the result &"("& sysError()&")"
exit to top
end if
get binarydecode("H*", md5digest(tData), tCheckSum)
return tCheckSum
end fileMd5Digest
Also, check the limits of the binaryDecode function. It may be that you're reading the whole file but binaryDecode can only convert so much at a time.