If you don't rewind + update + flush header, the current seek position shows to
authorRoland Haeder <roland@mxchange.org>
Tue, 20 May 2014 19:55:08 +0000 (21:55 +0200)
committerRoland Haeder <roland@mxchange.org>
Tue, 20 May 2014 19:55:08 +0000 (21:55 +0200)
the end of the file. This is not what you want with empty files as the seek
position must show to zero (only "virgin" files).

Signed-off-by: Roland H├Ąder <roland@mxchange.org>
inc/classes/main/class_BaseFrameworkSystem.php

index 06f3a4d..be6499d 100644 (file)
@@ -3054,6 +3054,15 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
                // Simple flush file header which will create it.
                $this->flushFileHeader();
 
                // Simple flush file header which will create it.
                $this->flushFileHeader();
 
+               // Seek to beginning of file
+               $this->getIteratorInstance()->rewind();
+
+               // And update seek position ...
+               $this->updateSeekPosition();
+
+               // ... to write it back into the file
+               $this->flushFileHeader();
+
                //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] EXIT!!', __METHOD__, __LINE__));
        }
 
                //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] EXIT!!', __METHOD__, __LINE__));
        }