Main Content

slIsFileChangedOnDisk

Determine whether model has changed since it was loaded

Description

example

tf = slIsFileChangedOnDisk(sys) returns whether the file that contains block diagram sys has changed on disk since the block diagram was loaded.

Examples

collapse all

To ensure that code is not generated for a model whose file has changed on disk since it was loaded, include the following in the 'entry' section of the STF_make_rtw_hook.m file.

if (slIsFileChangedOnDisk(sys))
	error('File has changed on disk since it was loaded. Aborting code generation.');
end

For more information, see Customize Build Process with STF_make_rtw_hook File (Simulink Coder).

Input Arguments

collapse all

System name, specified as a character vector or string scalar.

Data Types: char | string

Output Arguments

collapse all

True or false result, returned as a 1 or 0 of data type logical.

  • 1 (true) — File that contains block diagram sys has changed on disk since the block diagram was loaded.

  • 0 (false) — File that contains block diagram sys has not changed on disk since the block diagram was loaded.

Introduced in R2007b