get_file Interface

public interface get_file

Module Procedures

private subroutine get_file_char(filename, file, err, delete)

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

Arguments

Type IntentOptional 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

private subroutine get_file_string(filename, file, err, 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.

Arguments

Type IntentOptional 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