If the file exists, open it for reading and writing, but don't discard existing content; else, create it.
Isn't it a very common use case? Why does fopen not seemingly support this?
Note that I don't want to append. I want to read and overwrite some part of the existing content while keep other parts.