Does the specified path exist and is it a directory?

If the path does not exist the returned Promise will resolve
to FALSE. It will NOT reject with an error.

@param string $path An absolute file system path
@return \Amp\Promise<bool>
771691
public function isdir(string $path): Promise
    {
        if (!@\file_exists($path)) {
            return new Success(false);
        }

        $isDir = @\is_dir($path);
        \clearstatcache(true, $path);

        return new Success($isDir);
    }
1179972
protected function makeDirectory($path)
    {
        if (!is_dir(dirname($path))) {
            mkdir(dirname($path), 0777, true);
        }

        return $path;
    }
373116
private function createFilePath($path)
    {
        $dir = dirname($path);
        return file_exists($dir) || FileHelper::createDirectory($dir, 0775, true);
    }
868868
public function existsChunk($path)
    {
        $path = Alias::getAlias($path, ['lang' => $this->locale]);
        if (!pathinfo($path, PATHINFO_EXTENSION)) {
            $path .= '.' . $this->defaultExtension;
        }

        return file_exists($path);
    }
670936
protected static function verifyPath(string $path = ''): bool
    {
        static::init();
        $currentDir = '.'.DIRECTORY_SEPARATOR;
        return (\stripos($path, static::$documentRoot) !== false && \strpos($path, $currentDir) === false);
    }
779399
public function exists($path)
    {
        $keys       = $this->explode($path);
        $parameters = $this->parameters;

        foreach ($keys as $key) {
            if (!is_array($parameters)) {
                return false;
            }
            if (array_key_exists($key, $parameters)) {
                $parameters = $parameters[$key];
            } else {
                return false;
            }
        }
        return true;
    }
39784
protected function findAbsolutePath($path)
    {
        if (is_file($path) || is_dir($path)) {
            return realpath($path);
        }

        if (null === $this->basePath) {
            return false;
        }

        if (is_file($this->basePath . DIRECTORY_SEPARATOR . $path)
               || is_dir($this->basePath . DIRECTORY_SEPARATOR . $path)) {
            return realpath($this->basePath . DIRECTORY_SEPARATOR . $path);
        }

        return false;
    }
1198902
public function has(string $path)
    {
        $path = Util::normalizePath($path);

        return $path === '' ? false : (bool) $this->adapter->has($path);
    }
197501
protected function validatePath($path)
    {
        if (empty($path)) {
            return false;
        }

        // we are always operating from root directory
        // so forbid relative paths
        if (false !== strpos($path, '..')) {
            return false;
        }

        return true;
    }
481011
public function isDir($path)
    {
        $node = $this->at($path);
        return null !== $node && 'dir' === $node->type;
    }
240604
public static function resolve($path)
    {
        if (empty($path)) {
            return false;
        }

        $path = Uri::canonpath($path);

        if ($path . '/' === self::path() || strpos($path, self::path()) === 0) {
            return $path;
        }

        return self::path() . $path;
    }
1050780
protected function verifyPath($path){
		if (file_exists($path)) return true;
			
		if (mkdir($path, 0777, true)) return true;
				
		return false;
	}
1150756
public static function checkPath($path)
    {
        if (!is_string($path)) {
            throw new InvalidArgumentException(sprintf("String expected as path, got '%s' instead", gettype($path)));
        }
        if (!file_exists($path)) {
            throw new InvalidArgumentException(sprintf("'%s' does not exist", $path));
        }

        if (!is_dir($path)) {
            throw new InvalidArgumentException(sprintf("'%s' is not a directory", $path));
        }

        if (!is_readable($path)) {
            throw new InvalidArgumentException(sprintf("'%s' is not readable", $path));
        }

        return true;
    }
1346540
public function size(string $path): Promise
    {
        if (!@\file_exists($path)) {
            return new Failure(new FilesystemException(
                "Path does not exist"
            ));
        }

        if (!@\is_file($path)) {
            return new Failure(new FilesystemException(
                "Path is not a regular file"
            ));
        }

        if (($size = @\filesize($path)) === false) {
            return new Failure(new FilesystemException(
                \error_get_last()["message"]
            ));
        }

        \clearstatcache(true, $path);
        return new Success($size);
    }
204717
public function makeDirectory($path)
    {
        $this->fs[$path] = $this->newDir();
        $this->fs[$path]->setPath($path);
        return $this->fs[$path];
    }
327152
private static function checkSavePath($path) {
            if (is_string($path)) {
                $dir = dirname($path);

                return file_exists($dir) && is_writeable($dir);
            } elseif (is_resource($path)) {
                return true;
            }

            return false;
        }
317728
private function checkPath($path)
    {
        return file_exists($path) && is_readable($path) && ($resources = scandir($path)) && (count($resources) > 2);
    }