]> git.mxchange.org Git - core.git/blobdiff - inc/classes/main/file_directories/class_BaseFileIo.php
More commented out.
[core.git] / inc / classes / main / file_directories / class_BaseFileIo.php
index 8cc8f60b11cc3f91949c83e996adf41482f291e4..f33024c69bd04934d1485521cafad296da6c0b06 100644 (file)
@@ -128,7 +128,7 @@ class BaseFileIo extends BaseFrameworkSystem {
         *
         * @return      $seekPosition   Current seek position
         */
-       public final function getPosition () {
+       public final function getSeekPosition () {
                return ftell($this->getPointer());
        }
 
@@ -144,6 +144,7 @@ class BaseFileIo extends BaseFrameworkSystem {
                $status = fseek($this->getPointer(), $offset, $whence);
 
                // Return status
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] status=%d', __METHOD__, __LINE__, $status));
                return $status;
        }
 
@@ -151,21 +152,26 @@ class BaseFileIo extends BaseFrameworkSystem {
         * Size of this file
         *
         * @return      $size   Size (in bytes) of file
+        * @todo        Handle seekStatus
         */
        public function size () {
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] CALLED!', __METHOD__, __LINE__));
+
                // Get current seek position
-               $seekPosition = $this->getPosition();
+               $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=%d', __METHOD__, __LINE__, $seekStatus));
 
                // Get position again  (which is the end of the file)
-               $size = $this->getPosition();
+               $size = $this->getSeekPosition();
 
                // Reset seek position to old
                $this->seek($seekPosition);
 
                // Return size
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] size=%s - EXIT!', __METHOD__, __LINE__, $size));
                return $size;
        }
 }