public function rename($oldname, $newname) { if (!in_array($savedir = dirname($newname), array('.', '/'))) { $this->mkdirs($savedir); } $oldname = $this->rootPath . WindSecurity::escapeDir($oldname); $this->sendcmd('RNFR', $oldname); return $this->sendcmd('RNTO', $newname); }