17.14.1 Determining the state of a FILE stream

Gnulib modules: freadable, fwritable, freading, fwriting

The freadable function returns true if the given stream supports reading, false if it supports only writing, i.e. if it was opened write-only or append-only.

The fwritable function returns true if the given stream supports writing, false if it supports only reading.

The freading function returns true if the given stream is opened read-only, or if the last operation on the stream was a read operation.

The fwriting function returns true if the given stream is opened write-only or append-only, or if the last operation on the stream was a write operation.

freading and fwriting will never both be true on the same stream at the same time. If the stream supports both reads and writes, then

depending on the underlying implementation.