public function glob($pattern)
    {
        $matched = [];
        $pattern = $this->realpath($pattern);
        $pattern = '@^' . str_replace(['\*', '\?'], ['[^\\\/]*', '.'], preg_quote($pattern)) .'$@';
        foreach (array_keys($this->files) as $path) {
            if (preg_match($pattern, $path))
                $matched[] = $path;
        }
        return $matched;
    }