Main Content

slIsFileChangedOnDisk

R2026b

Check whether model has changed since loading

Description

tf = slIsFileChangedOnDisk(sys) returns whether the file containing the specified model has changed on disk since the model was loaded.

example

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

Name of model to check, specified as a string or character vector.

Example: "myModel"

Data Types: string | character vector

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 model was loaded.

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

Data Types: logical

Version History

Introduced in R2007b