Opened 14 years ago

Closed 11 years ago

#1312 closed defect (invalid)

Modelica.Utilities.Streams.readLine should use $OPENMODELICALIBRARY/relativeFilePath.

Reported by: Adrian Pop Owned by: Adrian Pop
Priority: high Milestone:
Component: Run-time Version: 1.6.0
Keywords: Cc: Adrian Pop, Per Östlund, Martin Sjölund

Description

While checking Modelica.Utilities.Examples.readRealParameterModel we get this error:

Checking: model Modelica.Utilities.Examples.readRealParameterModel... Not possible to open file "Modelica/Utilities/data/Examples_readRealParameters.txt" for reading:
No such file or directory
Not possible to open file "Modelica/Utilities/data/Examples_readRealParameters.txt" for reading:
No such file or directory
Not possible to open file "Modelica/Utilities/data/Examples_readRealParameters.txt" for reading:
No such file or directory
2.12099999999919 seconds -> OK
	Check of Modelica.Utilities.Examples.readRealParameterModel completed successfully.

We should open the file by prefixing the name with OPENMODELICALIBRARY:

$OPENMODELICALIBRARY/Modelica/Utilities/data/Examples_readRealParameters.txt

This should be done in the external implementation of

Modelica.Utilities.Streams.readLine

(and any other function that works with files)

I assigned this bug to me, Per and Martin. Whoever has time first :)

Change History (3)

comment:1 by Martin Sjölund, 14 years ago

Actually, the base of the loaded Modelica library; OPENMODELICALIBRARY path may contain multiple paths.

comment:2 by Adrian Pop, 14 years ago

And also the actual name of the directory might not be Modelica, but Modelica 3.1 or such.

OPENMODELICAHOME=/path/to/library
The path/to/library contains directories:
Modelica 2.2.2
Modelica 3.1
...

We need to find a GOOD way to store the directory leading to a package and the package name:

(Modelica, "/path/to/library/Modelica 3.1", version = versionFromFile)
(Modelica, "/path/to/library/Modelica 2.2.2", version = versionFromFile)

For this to work we also need a simplified parser that only peeks into the file
to get the above information: the names of the top packages and the version annotations.

comment:3 by Martin Sjölund, 11 years ago

Cc: adrpo, adrpo, perost, sjoelund.se → adrpo, perost, sjoelund.se
Component: Run-time
Resolution: invalid
Status: assignedclosed

This has been resolved in MSL 3.2.1, where the user instead specifies files relative to the library using modelica:// URIs.

Note: See TracTickets for help on using tickets.