This package contains functions to interact with the environment.
Extends from Modelica.Icons.Package (Icon for standard packages).
Name | Description |
---|---|
getWorkDirectory | Get full path name of work directory |
setWorkDirectory | Set work directory |
getEnvironmentVariable | Get content of environment variable |
setEnvironmentVariable | Set content of local environment variable |
command | Execute command in default shell |
exit | Terminate execution of Modelica environment |
Extends from Modelica.Icons.Function (Icon for functions).
Type | Name | Description |
---|---|---|
String | directory | Full path name of work directory |
function getWorkDirectory "Get full path name of work directory" extends Modelica.Icons.Function; output String directory "Full path name of work directory"; // POSIX function "getcwd" external "C" directory = ModelicaInternal_getcwd(0);end getWorkDirectory;
Extends from Modelica.Icons.Function (Icon for functions).
Type | Name | Default | Description |
---|---|---|---|
String | directory | New work directory |
function setWorkDirectory "Set work directory" extends Modelica.Icons.Function; input String directory "New work directory"; // POSIX function "chdir" external "C" ModelicaInternal_chdir(directory);end setWorkDirectory;
Extends from Modelica.Icons.Function (Icon for functions).
Type | Name | Default | Description |
---|---|---|---|
String | name | Name of environment variable | |
Boolean | convertToSlash | false | True, if native directory separators in 'result' shall be changed to '/' |
Type | Name | Description |
---|---|---|
String | content | Content of environment variable (empty, if not existent) |
Boolean | exist | = true, if environment variable exists; = false, if it does not exist |
function getEnvironmentVariable "Get content of environment variable" extends Modelica.Icons.Function; input String name "Name of environment variable"; input Boolean convertToSlash = false "True, if native directory separators in 'result' shall be changed to '/'"; output String content "Content of environment variable (empty, if not existent)"; output Boolean exist "= true, if environment variable exists; = false, if it does not exist"; external "C" ModelicaInternal_getenv(name, convertToSlash, content, exist);end getEnvironmentVariable;
Extends from Modelica.Icons.Function (Icon for functions).
Type | Name | Default | Description |
---|---|---|---|
String | name | Name of environment variable | |
String | content | Value of the environment variable | |
Boolean | convertFromSlash | false | True, if '/' in content shall be changed to the native directory separator |
function setEnvironmentVariable "Set content of local environment variable" extends Modelica.Icons.Function; input String name "Name of environment variable"; input String content "Value of the environment variable"; input Boolean convertFromSlash = false "True, if '/' in content shall be changed to the native directory separator"; external "C" ModelicaInternal_setenv(name, content, convertFromSlash);end setEnvironmentVariable;
Extends from Modelica.Icons.Function (Icon for functions).
Type | Name | Default | Description |
---|---|---|---|
String | string | String to be passed to shell |
Type | Name | Description |
---|---|---|
Integer | result | Return value from command (depends on environment) |
function command "Execute command in default shell" extends Modelica.Icons.Function; input String string "String to be passed to shell"; output Integer result "Return value from command (depends on environment)"; external "C" result = system(string);end command;
Type | Name | Default | Description |
---|---|---|---|
Integer | status | 0 | Result to be returned by environment (0 means success) |
function exit "Terminate execution of Modelica environment" extends Modelica.Icons.Function; input Integer status=0 "Result to be returned by environment (0 means success)"; external "C" ModelicaInternal_exit(status);end exit;