WOLFRAM SYSTEM MODELER
loadResourceReturn the absolute path name of a URI or local file name |
SystemModel["Modelica.Utilities.Files.loadResource"]
This information is part of the Modelica Standard Library maintained by the Modelica Association.
fileReference = Files.loadResource(uri);
The function call "Files.loadResource(uri)
" returns the
absolute path name of the file that is either defined by an URI or by a local
path name. With the returned file name it is possible to
access the file with function calls of the C standard library.
If the data or file is stored in a data-base,
this might require copying the resource to a temporary folder and referencing that.
The implementation of this function is tool specific. However, at least Modelica URIs (see "chapter 13.2.3 External Resources" of the Modelica Specification), as well as absolute local file path names are supported.
file1 = loadResource("modelica://Modelica/Resources/Data/Utilities/Examples_readRealParameters.txt") // file1 is the absolute path name of the file file2 = loadResource("C:\\data\\readParameters.txt") file2 = "C:/data/readParameters.txt"
uri |
Type: String Description: URI or local file name |
---|
fileReference |
Type: String Description: Absolute path name of file |
---|