open/[3,4]: 2nd argument
QP_stream: unsigned char mode
This field indicates whether the stream is created for input or output mode.
The mode field is QP_READ for an input (read only) stream,
QP_WRITE or QP_APPEND for an output stream.
This field should not be changed for the lifetime of a stream.