Module collecting commands to conveniently interface with system commands
Extract directory component from a file path (“.” if none is present)
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | path |
Input file path |
Extracted directory path
Try to determine if we run on Unix and probably can rely on POSIX compliance
Operating system seems to be Unix
Try to determine if we run on Windows and don’t have POSIX compliance around
Operating system seems to be Windows
Join directory and leaf path segments with OS file separator
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | a1 |
Leading path segment |
||
| character(len=*), | intent(in) | :: | a2 |
Trailing path segment |
Joined path string
Obtain the command line argument at a given index
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(in) | :: | idx |
Index of command line argument, range [0:command_argument_count()] |
||
| character(len=:), | intent(out), | allocatable | :: | arg |
Command line argument |
Obtain the value of an environment variable
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | var |
Name of variable |
||
| character(len=:), | intent(out), | allocatable | :: | val |
Value of variable |