If the file doesn't exist as it has to be created first, then this exception
authorRoland Haeder <roland@mxchange.org>
Tue, 26 May 2015 21:20:25 +0000 (23:20 +0200)
committerRoland Haeder <roland@mxchange.org>
Tue, 26 May 2015 21:20:25 +0000 (23:20 +0200)
would always be thrown, so for a "random access file", this is bad news.

Signed-off-by: Roland H├Ąder <roland@mxchange.org>
inc/classes/main/file_directories/io/class_FrameworkFileInputOutputPointer.php

index edf9f57..a86a8d3 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)) {