X-Git-Url: https://git.mxchange.org/?p=core.git;a=blobdiff_plain;f=inc%2Fclasses%2Fmain%2Ffile_directories%2Fio%2Fclass_FrameworkFileInputOutputPointer.php;h=198c5b09df6c463f8bcdd9a4ee8f84b1d24f7bad;hp=cebb1fad9229640ca38b27f845fe6a8f9cbb6a03;hb=8557e30c478c289b89a8dc241eb55b838aead662;hpb=79968ab0f673b50f09f35aed9bdc8112558e1553 diff --git a/inc/classes/main/file_directories/io/class_FrameworkFileInputOutputPointer.php b/inc/classes/main/file_directories/io/class_FrameworkFileInputOutputPointer.php index cebb1fad..198c5b09 100644 --- a/inc/classes/main/file_directories/io/class_FrameworkFileInputOutputPointer.php +++ b/inc/classes/main/file_directories/io/class_FrameworkFileInputOutputPointer.php @@ -57,7 +57,7 @@ class FrameworkFileInputOutputPointer extends BaseFileIo implements InputOutputP } // Try to open a handler - $filePointer = fopen($fileName, 'a+b'); + $filePointer = fopen($fileName, 'c+b'); if ((is_null($filePointer)) || ($filePointer === FALSE)) { // Something bad happend throw new FileIoException($fileName, self::EXCEPTION_FILE_POINTER_INVALID); @@ -121,11 +121,11 @@ class FrameworkFileInputOutputPointer extends BaseFileIo implements InputOutputP /** * Rewinds to the beginning of the file * - * @return void + * @return $status Status of this operation */ public function rewind () { // Rewind the pointer - assert(rewind($this->getPointer() === 1); + return rewind($this->getPointer()); } /** @@ -133,11 +133,11 @@ class FrameworkFileInputOutputPointer extends BaseFileIo implements InputOutputP * * @param $seekPosition Seek position in file * @param $whence "Seek mode" (see http://de.php.net/fseek) - * @return void + * @return $status Status of this operation */ public function seek ($seekPosition, $whence = SEEK_SET) { // Move the file pointer - assert(fseek($this->getPointerInstance(), $seekPosition, $whence) === 0); + return fseek($this->getPointer(), $seekPosition, $whence); } }