$status = fseek($this->getPointer(), $offset, $whence);
// Return status
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] status=%s', __METHOD__, __LINE__, $status));
return $status;
}
* @return $size Size (in bytes) of file
*/
public function size () {
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] CALLED!', __METHOD__, __LINE__));
+
// Get current seek position
$seekPosition = $this->getSeekPosition();
// Seek to end
- $this->seek(0, SEEK_END);
+ $seekStatus = $this->seek(0, SEEK_END);
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] seekStatus=%s', __METHOD__, __LINE__, $seekStatus));
// Get position again (which is the end of the file)
$size = $this->getSeekPosition();
$this->seek($seekPosition);
// Return size
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] size=%s - EXIT!', __METHOD__, __LINE__, $size));
return $size;
}
}
* @return $isInitialized Whether the file header is initialized
*/
private function isFileHeaderInitialized () {
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] CALLED!', __METHOD__, __LINE__));
// Default is not initialized
$isInitialized = FALSE;
// Is the file initialized?
if ($this->isFileInitialized()) {
// Some bytes has been written, so rewind to start of it.
- $this->getIteratorInstance()->rewind();
+ $rewindStatus = $this->getIteratorInstance()->rewind();
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] rewindStatus=%s', __METHOD__, __LINE__, $rewindStatus));
// Read file header
$this->readFileHeader();
} // END - if
// Return result
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] isInitialized=%d - EXIT!', __METHOD__, __LINE__, intval($isInitialized)));
return $isInitialized;
}
private function isFileInitialized () {
// Get it from iterator which holds the pointer instance. If FALSE is returned
$fileSize = $this->getIteratorInstance()->size();
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] fileSize=%s', __METHOD__, __LINE__, $fileSize));
/*
* The returned file size should not be FALSE or NULL as this means
$isInitialized = ($fileSize > 0);
// Return result
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] isInitialized=%d - EXIT!', __METHOD__, __LINE__, intval($isInitialized)));
return $isInitialized;
}