From d6e26d0565685dbdba5ba14dd7e9c44c26b1378e Mon Sep 17 00:00:00 2001 From: Roland Haeder Date: Tue, 20 May 2014 21:55:08 +0200 Subject: [PATCH] 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). MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Roland Häder --- inc/classes/main/class_BaseFrameworkSystem.php | 9 +++++++++ 1 file changed, 9 insertions(+) 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__)); } -- 2.39.2