dm_file_read Subroutine

public subroutine dm_file_read(path, content, size, error)

Reads file contents as byte stream into allocatable character string.

The routine returns the following error codes in argument error:

  • E_ALLOC if the allocation if content failed.
  • E_IO if opening the file failed.
  • E_READ if reading from file failed.

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: path

File path.

character(len=:), intent(out), allocatable :: content

Byte string.

integer(kind=i8), intent(out), optional :: size

Content size.

integer, intent(out), optional :: error

Error code.