Reading and writing whole files as bytes, so that line endings are preserved on every platform.
All bytes of file path.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | path |
the file to read |
||
| character(len=:), | intent(out), | allocatable | :: | text |
the contents; |
|
| integer, | intent(out) | :: | stat |
|
||
| character(len=:), | intent(out), | allocatable | :: | errmsg |
the system's message, if |
All of standard input. Lines are read as text, so each line ends with a line feed, except a last line without one; carriage returns of CRLF line endings are kept as part of the line.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=:), | intent(out), | allocatable | :: | text |
the input |
Replace the contents of file path (created if needed) with the bytes of text.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | path |
the file to write |
||
| character(len=*), | intent(in) | :: | text |
the new contents |
||
| integer, | intent(out) | :: | stat |
|
||
| character(len=:), | intent(out), | allocatable | :: | errmsg |
the system's message, if |