buffer = "Starting file dumper of ".$path; $this->path = "./"; $this->construct_tree($this->path); } function construct_tree($path) { $this->handle = opendir($path) or die("error #1"); echo "
Directory: ".$path. "
"; while(false !== ($this->file = readdir($this->handle))) { if(!in_array($this->file,$this->not_countable)) { if(is_file($this->file)) { echo($this->file."
"); } elseif(is_dir($this->file)) { $this->construct_tree($this->file."/"); } } } closedir($this->handle); } } $ins = new file_tree(); ?> // 0utput Directory: ./ asd.php Directory: new_cms/ asd.php Warning: readdir(): 3 is not a valid Directory resource in /www/05/nero.pri.ee/erti/file_tree.php on line 23 Warning: closedir(): 3 is not a valid Directory resource in /www/05/nero.pri.ee/erti/file_tree.php on line 32