MATLAB: Is there an alternative to SLISFILECHANGEDONDISK function for versions of MATLAB before R2007b

datedirsimulinkslisfilechangedondisk

I have a model file open (opened at time Tx) under a MATLAB session A which is being edited. Before saving changes from MATLAB session A (at time Ty) to disk, I'd like to determine whether the model file has not changed on disk, that is, catch the case in which the file was edited and saved from another MATLAB session B.
(detect a save from another MATLAB session B at a time Tz where, Tx > Tz > Ty)
I learned that R2007b provides the SLISFILECHANGEDONDISK(sys) which could be used to determine the above describe scenario.
I need a workaround for MATLAB versions prior to R2007b.

Best Answer

There are no alternatives to SLISFILECHANGEDONDISK function for versions of MATLAB before R2007b.
As a workaround, use the DATE field of the structure returned by DIR function to check the time when a particular file was last modified.