If the file doesn't exist as it has to be created first, then this exception
[core.git] / inc / classes / main / file_directories / io / class_FrameworkFileInputOutputPointer.php
index edf9f5728a4dae33058261bed2f3af15fbd3e56d..a86a8d3a3b46da815015b6e1b1e819b0aa4edd98 100644 (file)
@@ -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)) {