AixLib.BoundaryConditions.WeatherData.BaseClasses.getAbsolutePath

# .AixLib.BoundaryConditions.WeatherData.BaseClasses.getAbsolutePath

Gets the absolute path of a URI

## Information

The function returns the absolute path of a uniform resource identifier (URI) or local file name. 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.

#### Interface

>     pure function getAbsolutePath
>       extends Modelica.Icons.Function;
>       input String uri "A URI";
>       output String path "The absolute path of the file pointed to by the URI";
>     end getAbsolutePath;

## Revisions

- December 11, 2021, by Michael Wetter:
  Removed assertion if file does not exist. This has been removed because it makes the function impure, and then the test AixLib.BoundaryConditions.WeatherData.BaseClasses.Examples.GetAbsolutePath fails.
- July 07, 2016, by Thierry S. Nouidui:
  Removed the use of `Modelica.Utilities.Files.fullPathName` which is implicitly done in `Modelica.Utilities.Files.loadResource`.
  Removed the addition of `file://` to file names which do not start with `file://`, or `modelica://`. This is not required when using `Modelica.Utilities.Files.loadResource`.
- April 21, 2016, by Michael Wetter:
  Replaced `ModelicaServices.ExternalReferences.loadResource` with `Modelica.Utilities.Files.loadResource`.
- 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 `AixLib` library is on the `MODELICAPATH`.
- May 2, 2013, by Michael Wetter:
  First implementation.

Generated at 2026-05-09T18:18:56Z by OpenModelicaOpenModelica 1.26.7 using GenerateDoc.mos