Details

For details about the behaviour, see gFileReplace which does the same
thing but returns an output stream only.

Note that in many non-local file cases read and write streams are not
supported, so make sure you really need to do read and write streaming,
rather than just opening for reading or writing.
Since 2.22