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