annotate general/fileutils/md5file.m @ 19:1eb0ea29ec40

Doesn't belong here.
author samer
date Thu, 17 Jan 2013 13:32:19 +0000
parents 47cb292350f3
children
rev   line source
samer@7 1 % md5file - Use md5sum to compute md5 hash
samer@7 2 % md5file :: string ~'filename' -> string ~'hash'.
samer@4 3 function hash=md5file(fn)
samer@4 4 [rc,result]=system(sprintf('md5sum -b "%s"',fn));
samer@4 5 if rc==0
samer@4 6 sp=find(result==' ');
samer@4 7 hash=result(1:sp);
samer@4 8 else
samer@4 9 error('Error running md5sum');
samer@4 10 end
samer@4 11 end