- open file for writing (with + also for reading aka "random access mode")
- if file does not exist, create it
- if file exists, don't truncate (unlike 'w' does) and don't fail (unlike 'x'
does).
- set seek position to beginning of file
- 'b' is for binary data
Signed-off-by: Roland Häder <roland@mxchange.org>
}
// Try to open a handler
- $filePointer = fopen($fileName, 'a+b');
+ $filePointer = fopen($fileName, 'c+b');
if ((is_null($filePointer)) || ($filePointer === FALSE)) {
// Something bad happend
throw new FileIoException($fileName, self::EXCEPTION_FILE_POINTER_INVALID);