Reads a whole ASCII file and loads its contents into an allocatable character
variable.
The function handles error states and optionally deletes the file after reading.
Check if the file should be deleted after reading
Check file existing
Retrieve file size
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | filename |
Input file name |
||
character(len=:), | intent(out), | allocatable | :: | file |
Output string variable |
|
type(state_type), | intent(out), | optional | :: | err |
[optional] State return flag. On error, if not requested, the code will stop. |
|
logical, | intent(in), | optional | :: | delete |
[optional] Delete file after reading? Default: do not delete |
Reads a whole ASCII file and loads its contents into a string variable. The function handles error states and optionally deletes the file after reading.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | filename |
Input file name |
||
type(string_type), | intent(out) | :: | file |
Output string variable |
||
type(state_type), | intent(out), | optional | :: | err |
[optional] State return flag. On error, if not requested, the code will stop. |
|
logical, | intent(in), | optional | :: | delete |
[optional] Delete file after reading? Default: do not delete |