The 'c' mode will do the following:
authorRoland Haeder <roland@mxchange.org>
Sat, 17 May 2014 21:30:48 +0000 (23:30 +0200)
committerRoland Haeder <roland@mxchange.org>
Sat, 17 May 2014 21:30:48 +0000 (23:30 +0200)
- 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>
inc/classes/main/file_directories/io/class_FrameworkFileInputOutputPointer.php

index da4096f9c794a8a15fa64035b0288b5bfb32cb3b..b167fee3d363d409865c577e24500c5d2e9534d7 100644 (file)
@@ -57,7 +57,7 @@ class FrameworkFileInputOutputPointer extends BaseFileIo implements InputOutputP
                }
 
                // Try to open a handler
                }
 
                // 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);
                if ((is_null($filePointer)) || ($filePointer === FALSE)) {
                        // Something bad happend
                        throw new FileIoException($fileName, self::EXCEPTION_FILE_POINTER_INVALID);