functionloadResource
Extends from Modelica.Utilities.Internal.PartialModelicaServices.ExternalReferences.PartialLoadResource (Interface for tool specific function to return the absolute path name of a URI or local file name), ModelicaServices.ExternalReferences.loadResource (Return the absolute path name of a URI or local file name (in this default implementation URIs are not supported, but only local file names)).
Information
Syntax
fileReference = Files.loadResource(uri);
Description
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 Section 13.5 External Resources of the Modelica 3.6 specification), as well as absolute local file path names are supported.
Example
file1 = loadResource("resources/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"
Inputs
| Type | Name | Default | Description |
|---|---|---|---|
| String | uri (from PartialLoadResource) | URI or local file name |
Outputs
| Type | Name | Default | Description |
|---|---|---|---|
| String | fileReference (from PartialLoadResource) | Absolute path name of file |