public function removeFile($file) { try { $this->ftp('delete', $file); } catch (FtpException $e) { if (in_array($file, (array) $this->ftp('nlist', $file . '*'))) { throw $e; } } }