Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. Filesystem.php

function Filesystem::isReadable

Same name in this branch
  1. 11.1.x vendor/composer/composer/src/Composer/Util/Filesystem.php \Composer\Util\Filesystem::isReadable()

Tells whether a file exists and is readable.

Throws

IOException When windows path is longer than 258 characters

1 call to Filesystem::isReadable()
Filesystem::rename in vendor/symfony/filesystem/Filesystem.php
Renames a file or a directory.

File

vendor/symfony/filesystem/Filesystem.php, line 313

Class

Filesystem
Provides basic utility to manipulate the file system.

Namespace

Symfony\Component\Filesystem

Code

private function isReadable(string $filename) : bool {
    $maxPathLength = \PHP_MAXPATHLEN - 2;
    if (\strlen($filename) > $maxPathLength) {
        throw new IOException(\sprintf('Could not check if file is readable because path length exceeds %d characters.', $maxPathLength), 0, null, $filename);
    }
    return is_readable($filename);
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal