tem_file_to_string Subroutine

public subroutine tem_file_to_string(funit, string, iError)

Read a file from a connected unit into a string.

The connected file has to be opened for sequential formatted access. A string will be returned containing the characters read from the file. If there are potential problems arising, they are returned in the error code iError

Arguments

TypeIntentOptionalAttributesName
integer, intent(in) :: funit

File unit to read, has to be opened sequential and formatted.

character(len=*), intent(out) :: string

String to fill with the content of the file.

integer, intent(out) :: iError

Error code:

0 = no error 1 = end of string reached before end of file 2 = Unit not connected


Contents


Variables

TypeVisibilityAttributesNameInitial
integer, private :: old_pos
integer, private :: length
integer, private :: stringlen
integer, private :: io
logical, private :: nUnitOpened
character(len=PathLen), private :: loc_string