Attempts to open the file at the path specified by `p` with the mode specified by `m`. Upon success, a subsequent call to `f.is_open()` will return `true`. If `f` refers to an open file, it is first closed as if by a call to `close` with the error ignored. The function will ensure that `!ec` is `true` if there was no error or set to the appropriate error code if an error occurred.
Attempts to open the file at the path specified by `p` with the mode specified by `m`. Upon success, a subsequent call to `f.is_open()` will return `true`. If `f` refers to an open file, it is first closed as if by a call to `close` with the error ignored. The function will ensure that `!ec` is `true` if there was no error or set to the appropriate error code if an error occurred.