A record of the file modes that can write from a file.
A record of the file modes that can read from a file.
The file handle which will be used as a State Transition
resource in the IO
and IOExcept
implementations of File
.
The Mode
that the handle was generated under.
Description of state transition operations on a file.
+------------+-------------+----------------+----------------+----------------+
| Operation | State in | Mode in | State out | Mode out |
+------------+-------------+----------------+----------------+----------------+
| open | - | - | file handle | input paramater|
| close | file handle | any | - | - |
| eof | file handle | ValidModeRead | file handle | ValidModeRead |
| flush | file handle | any | file handle | unchanged |
| readLine | file handle | ValidModeRead | file handle | ValidModeRead |
| readChar | file handle | ValidModeRead | file handle | ValidModeRead |
| readFile | - | - | - | - |
| writeString| file handle | ValidModeWrite | file handle | ValidModeWrite |
| writeLine | file handle | ValidModeWrite | file handle | ValidModeWrite |
| writeFile | - | - | - | - |
+------------+-------------+----------------+----------------+----------------+
Open a file.
Close a file.
Have we reached the end of the file.
Flush
Read a complete line.
Read a Char
.
Read the contents of a file into a string.
This checks the size of
the file before beginning to read, and only reads that many bytes,
to ensure that it remains a total function if the file is appended
to while being read.
Returns an error if fname is not a normal file.
Write a complete line to the file.
Write a complete line to the file.
Create a file and write contents to the file.