0 if successful in writing
string to the output stream,
or 1 if an error occurs while writing the line.
The stream advances the write pointer.
If you specify line, this positions
the write pointer before writing.
If you omit both string and
line, the stream is closed.
If the stream is not already open, the stream attempts to open for reading
and writing. If that fails, the stream is opened for output only.