From: Roland Haeder Date: Tue, 26 May 2015 21:20:25 +0000 (+0200) Subject: If the file doesn't exist as it has to be created first, then this exception X-Git-Url: https://git.mxchange.org/?p=core.git;a=commitdiff_plain;h=b541bfee56699a028ff708e1f2d8fe92d9cfe2b0 If the file doesn't exist as it has to be created first, then this exception would always be thrown, so for a "random access file", this is bad news. Signed-off-by: Roland Häder --- diff --git a/inc/classes/main/file_directories/io/class_FrameworkFileInputOutputPointer.php b/inc/classes/main/file_directories/io/class_FrameworkFileInputOutputPointer.php index edf9f572..a86a8d3a 100644 --- a/inc/classes/main/file_directories/io/class_FrameworkFileInputOutputPointer.php +++ b/inc/classes/main/file_directories/io/class_FrameworkFileInputOutputPointer.php @@ -51,7 +51,7 @@ class FrameworkFileInputOutputPointer extends BaseFileIo implements InputOutputP } elseif (!BaseFrameworkSystem::isReachableFilePath($fileName)) { // File exists but cannot be read throw new FileIoException($fileName, self::EXCEPTION_FILE_NOT_REACHABLE); - } elseif (!BaseFrameworkSystem::isReadableFile($fileName)) { + } elseif ((!BaseFrameworkSystem::isReadableFile($fileName)) && (file_exists($fileName))) { // File exists but cannot be read throw new FileReadProtectedException($fileName, self::EXCEPTION_FILE_CANNOT_BE_READ); } elseif (!is_writable($fileName)) {