public function delete() { chdir($this->dir); foreach ($this->files as $file) { if (!is_writeable($file)) { throw new NotEnoughPrivileges('write', fileperms($file), $file); } unlink($file); } chdir($this->originDir); }