.Modelica.Utilities.Files.loadResource

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 "chapter 13.2.3 External Resources" of the Modelica Specification), as well as absolute local file path names are supported.

Example

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"

Interface

function loadResource
  extends Modelica.Utilities.Internal.PartialModelicaServices.ExternalReferences.PartialLoadResource;
  extends ModelicaServices.ExternalReferences.loadResource;
end loadResource;

Generated at 2024-12-24T19:25:53Z by OpenModelicaOpenModelica 1.24.3 using GenerateDoc.mos