From: Roland Haeder Date: Tue, 20 May 2014 19:55:08 +0000 (+0200) Subject: If you don't rewind + update + flush header, the current seek position shows to X-Git-Url: https://git.mxchange.org/?p=core.git;a=commitdiff_plain;h=d6e26d0565685dbdba5ba14dd7e9c44c26b1378e;ds=sidebyside If you don't rewind + update + flush header, the current seek position shows to 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 --- diff --git a/inc/classes/main/class_BaseFrameworkSystem.php b/inc/classes/main/class_BaseFrameworkSystem.php index 06f3a4d6..be6499dc 100644 --- a/inc/classes/main/class_BaseFrameworkSystem.php +++ b/inc/classes/main/class_BaseFrameworkSystem.php @@ -3054,6 +3054,15 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface { // 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__)); }