public function exists($filename)
    {
        $filename = $this->path($filename);

        if (!$this->isDirectory($filename)) {
            return file_exists($filename);
        }

        $tmp = getcwd();

        $r = chdir($filename);

        chdir($tmp);

        return $r;
    }