cpp/io/basic filebuf/open

If the associated file was already open, returns a null pointer right away.

Otherwise, opens the file with the given name ( or, depending on the overload). std values may be written as, e.g.,.

The file is opened as if by calling std with the second argument (file access mode) determined by the result of as follows,  fails if the result is not some combination of flags shown in the table:

If the open operation succeeds and (the  bit is set), repositions the file position to the end of file, as if by calling, where  is the pointer returned by calling std. If the repositioning fails, calls close and returns a null pointer to indicate failure.

Return value
on success, a null pointer on failure.