- Create a hash list file that consists of file names used by s-functions and corresponding hashes.
- Before simulation start, in InitFcn,
- Calculate hashes of files used by s-functions and compare them with the values saved in hash list file. Mark files whose hashes are different as "changed".
- If an existing binary mex file date is earlier than any of the dates of the source files used in its build, mark that binary as "changed".
- Mex files marked as "changed".
For hash calculation you can use [status, cmdout] = system(['certutil -hashfile', fileName, ' SHA256']) and parse cmdout via str=splitlines(cmdout); hash=str[2]; to get hash of file.
No comments:
Post a Comment