Open an existing serialized stream for reading.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | filename |
Path of the file to read. |
||
| integer(kind=default_int), | intent(out) | :: | unit |
Newly opened unit number, -1 when the open failed. |
||
| type(error_t), | intent(inout) | :: | err |
Error state, |
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| integer(kind=default_int), | private | :: | ios |
subroutine serialize_open_read(filename, unit, err) !! Open an existing serialized stream for reading. character(len=*), intent(in) :: filename !! Path of the file to read. integer(default_int), intent(out) :: unit !! Newly opened unit number, -1 when the open failed. type(error_t), intent(inout) :: err !! Error state, `ERROR_IO` if the file cannot be opened. integer(default_int) :: ios unit = -1_default_int open (newunit=unit, file=filename, form="unformatted", access="stream", & action="read", status="old", iostat=ios) call check_io(ios, "cannot open '"//filename//"' for reading", err) end subroutine serialize_open_read