|
GRASP
|
Functions/Subroutines | |
| subroutine | cpath (startdir, permdir, tmpdir) |
| logical function | getenv_allocating (variable_name, value) |
| Fetches an environment variable. More... | |
| subroutine cpath | ( | character(len=*), intent(out) | startdir, |
| character(len=*), intent(out) | permdir, | ||
| character(len=*), intent(out) | tmpdir | ||
| ) |


| logical function cpath::getenv_allocating | ( | character(*), intent(in) | variable_name, |
| character(:), intent(inout), allocatable | value | ||
| ) |
Fetches an environment variable.
If it was able to fetch the variable value, returns .true. and sets value to the value ([re]allocating if necessary). Returns .false. if the variable is not defined
Under the hood it calls get_environment_variable, but it properly allocates or re-allocates the value to match the actual length of the environment variable.
TODO: For this to be a proper library function, it should be implemented as an interface with additional methods to handle pointers and fixed-length strings.

1.8.13