functiongetAbsolutePath

Gets the absolute path of a URI

Information

This function returns the absolute path of the uniform resource identifier by searching for a file with the name

file://uri
modelica://uri
modelica://dhcSim/uri

The function returns the absolute path of the first file that is found, using the above search order. If the file is not found, then this function terminates with an assert.

This function has been introduced to allow users to specify the name of weather data files with a path that is relative to the library path. This allows users to change the current working directory while still being able to read the files.

Inputs

TypeNameDefaultDescription
StringuriA uri

Outputs

TypeNameDefaultDescription
StringpathThe absolute path of the file pointed to by the URI

Contents

NameDescription
loadResourceprotected

Revisions

  • October 8, 2013, by Michael Wetter:
    Improved algorithm that determines the absolute path of the file. Now the function works from any directory as long as the dhcSim library is on the MODELICAPATH.
  • May 2, 2013, by Michael Wetter:
    First implementation.