X-Git-Url: https://git.mxchange.org/?p=core.git;a=blobdiff_plain;f=inc%2Fclasses%2Fmain%2Ffile_directories%2Fio%2Fclass_FrameworkFileInputOutputPointer.php;fp=inc%2Fclasses%2Fmain%2Ffile_directories%2Fio%2Fclass_FrameworkFileInputOutputPointer.php;h=edf9f5728a4dae33058261bed2f3af15fbd3e56d;hp=fc4d780c7873f41b4cc1684d03de25b752e5b9c3;hb=de4993bdd2170972f3c004bf7473bfd2032c2dda;hpb=d61f4e1b3b96da51056889c6340d2e935d7e9972 diff --git a/inc/classes/main/file_directories/io/class_FrameworkFileInputOutputPointer.php b/inc/classes/main/file_directories/io/class_FrameworkFileInputOutputPointer.php index fc4d780c..edf9f572 100644 --- a/inc/classes/main/file_directories/io/class_FrameworkFileInputOutputPointer.php +++ b/inc/classes/main/file_directories/io/class_FrameworkFileInputOutputPointer.php @@ -48,12 +48,15 @@ class FrameworkFileInputOutputPointer extends BaseFileIo implements InputOutputP if ((is_null($fileName)) || (empty($fileName))) { // No filename given throw new FileIsEmptyException(NULL, self::EXCEPTION_UNEXPECTED_EMPTY_STRING); - } elseif ((file_exists($fileName)) && (!is_readable($fileName))) { + } elseif (!BaseFrameworkSystem::isReachableFilePath($fileName)) { + // File exists but cannot be read + throw new FileIoException($fileName, self::EXCEPTION_FILE_NOT_REACHABLE); + } elseif (!BaseFrameworkSystem::isReadableFile($fileName)) { // File exists but cannot be read throw new FileReadProtectedException($fileName, self::EXCEPTION_FILE_CANNOT_BE_READ); - } elseif ((file_exists($fileName)) && (!is_writable($fileName))) { + } elseif (!is_writable($fileName)) { // File exists but cannot be written - throw new FileWriteProtectedException($fileName, self::EXCEPTION_FILE_CANNOT_BE_READ); + throw new FileWriteProtectedException($fileName, self::EXCEPTION_FILE_CANNOT_BE_WRITTEN); } // Try to open a handler