+
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] EXIT!', __METHOD__, __LINE__));
+ }
+
+ /**
+ * Pre-allocates file (if enabled) with some space for later faster write access.
+ *
+ * @return void
+ */
+ private function preAllocateFile () {
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] CALLED!', __METHOD__, __LINE__));
+
+ // Is it enabled?
+ if ($this->getConfigInstance()->getConfigEntry('file_stack_pre_allocate_enabled') != 'Y') {
+ // Not enabled
+ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] Not pre-allocating stack file.', __METHOD__, __LINE__));
+
+ // Don't continue here.
+ return;
+ } // END - if
+
+ // Message to user
+ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] Pre-allocating stack file ...', __METHOD__, __LINE__));
+
+ /*
+ * Calculate minimum length for one entry:
+ * minimum length = hash length + separator + name + minimum entry size = ?? + 1 + 10 + 1 = ??
+ */
+ $minLengthEntry = self::getHashLength() + strlen(self::SEPARATOR_HASH_NAME) + self::COUNT_NAME + 1;
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] minLengthEntry=%s', __METHOD__, __LINE__, $minLengthEntry));
+
+ // Calulcate seek position
+ $seekPosition = $minLengthEntry * $this->getConfigInstanstance()->getConfigEntry('file_stack_pre_allocate_count');
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] seekPosition=%s', __METHOD__, __LINE__, $seekPosition));
+
+ // Now seek to the position
+ $this->getIteratorInstance()->seek($seekPosition);
+
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] EXIT!', __METHOD__, __LINE__));