.Modelica.Utilities.Files.loadResource

Information

Syntax

fileReference = FileSystem.loadResource(uri);

Description

The function call "FileSystem.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 2016-04-28T14:04:17Z by OpenModelica1.9.3+dev (r25613)