Rename Folder
@param string  $old_name
@param string  $new_name
@param boolean $expunge

@return bool
@throws ConnectionFailedException
358569
public function renameFolder($old_name, $new_name, $expunge = true) {
        $this->checkConnection();
        $status = imap_renamemailbox($this->getConnection(), $this->getAddress() . imap_utf7_encode($old_name), $this->getAddress() . imap_utf7_encode($new_name));
        if($expunge) $this->expunge();

        return $status;
    }
1286212
public function rename($oldFileName, $newFileName, $context, FilesystemAdapter $filesystemAdapter)
    {
        if ($filesystemAdapter->exists($context . '/' . $newFileName)) {
            throw new IcrRuntimeException("File with name {$newFileName} already exists!");
        }

        $image = $filesystemAdapter->get($context . '/' . $oldFileName);
        $filesystemAdapter->move($context . '/' . $oldFileName, $context . '/' . $newFileName);

        foreach ($this->config[$context] as $sizeName => $value) {
            $oldPath = $context . '/' . $sizeName . '/' . $oldFileName;
            $newPath = $context . '/' . $sizeName . '/' . $newFileName;
            $filesystemAdapter->move($oldPath, $newPath);
        }

        return true;
    }
249356
public static void rename(FileSystem fs, String oldName, String newName)
    throws IOException {
    Path oldDir = new Path(oldName);
    Path newDir = new Path(newName);
    if (!fs.rename(oldDir, newDir)) {
      throw new IOException("Could not rename " + oldDir + " to " + newDir);
    }
  }
213223
public function rename($oldName, $newName) {
        if (false === @ftp_rename($this->getConnection(), $oldName, $newName)) {
            throw $this->newFTPException(sprintf("rename %s into %s failed", $oldName, $newName));
        }
        return $this;
    }
1222591
public function rename($newpath)
    {
        if ($this->filesystem->rename($this->path, $newpath)) {
            $this->path = $newpath;

            return true;
        }

        return false;
    }
1176107
function rename($oldname, $newname)
    {
        if (!($this->bitmap & NET_SSH2_MASK_LOGIN)) {
            return false;
        }

        $oldname = $this->_realpath($oldname);
        $newname = $this->_realpath($newname);
        if ($oldname === false || $newname === false) {
            return false;
        }

        // http://tools.ietf.org/html/draft-ietf-secsh-filexfer-13#section-8.3
        $packet = pack('Na*Na*', strlen($oldname), $oldname, strlen($newname), $newname);
        if (!$this->_send_sftp_packet(NET_SFTP_RENAME, $packet)) {
            return false;
        }

        $response = $this->_get_sftp_packet();
        if ($this->packet_type != NET_SFTP_STATUS) {
            user_error('Expected SSH_FXP_STATUS');
            return false;
        }

        // if $status isn't SSH_FX_OK it's probably SSH_FX_NO_SUCH_FILE or SSH_FX_PERMISSION_DENIED
        if (strlen($response) < 4) {
            return false;
        }
        extract(unpack('Nstatus', $this->_string_shift($response, 4)));
        if ($status != NET_SFTP_STATUS_OK) {
            $this->_logError($response, $status);
            return false;
        }

        // don't move the stat cache entry over since this operation could very well change the
        // atime and mtime attributes
        //$this->_update_stat_cache($newname, $this->_query_stat_cache($oldname));
        $this->_remove_from_stat_cache($oldname);
        $this->_remove_from_stat_cache($newname);

        return true;
    }
545508
public static function renameImage($oldFileName, $newFileName, $context, $storage = 'local')
    {
        /** @var FilesystemAdapter $filesystemAdapter */
        $filesystemAdapter = Facades\Storage::disk($storage);
        /** @var Processor $processor */
        $processor = app('icr.processor');

        return $processor->rename($oldFileName, $newFileName, $context, $filesystemAdapter);
    }
835809
public function renameIndex($oldName, $newName)
    {
        if (!$this->hasIndex($oldName)) {
            throw SchemaException::tableIndexDoesNotExist($this->getName(), $oldName);
        }

        if ($this->hasIndex($newName)) {
            throw SchemaException::tableIndexAlreadyExists($this->getName(), $newName);
        }

        $this->indexes[$oldName]->setName($newName);
        $this->indexes[$newName] = $this->indexes[$oldName];
        unset($this->indexes[$oldName]);
    }
113434
public function rename($newName, $returnNew = true)
    {
        $this->db->setQuery(
            'RENAME TABLE ' . $this->db->quoteName($this->getName()) . ' TO ' . $this->db->quoteName($newName)
        );

        $this->db->execute();

        if ($returnNew) {
            return $this->db->getTable($newName);
        }

        return $this->reset();
    }
339733
public function renameColumn($oldName, $newName)
    {
        foreach ($this->rows as $row) {
            $row->renameColumn($oldName, $newName);

            $subTable = $row->getSubtable();
            if ($subTable) {
                $subTable->renameColumn($oldName, $newName);
            }
        }
        if (!is_null($this->summaryRow)) {
            $this->summaryRow->renameColumn($oldName, $newName);
        }
        if (!is_null($this->totalsRow)) {
            $this->totalsRow->renameColumn($oldName, $newName);
        }
    }
190362
def project_rename_folder(object_id, input_params={}, always_retry=False, **kwargs):
    
    return DXHTTPRequest('/%s/renameFolder' % object_id, input_params, always_retry=always_retry, **kwargs)
1107996
public function rename($oldPath, $newPath)
    {
        $old = $this->at($oldPath);
        $new = $this->at($newPath);

        if (null === $old || (null !== $new && 'dir' === $new->type))
            return false;

        if ('file' === $old->type) {
            $this->at($newPath, $old);
        } else {
            if (! $this->mkdir($newPath, $old->perms)) {
                return false;
            }
            $oldPath = $this->realpath($oldPath) . '/';
            $newPath = $this->realpath($newPath) . '/';
            $length = strlen($oldPath);
            foreach (array_keys($this->files) as $childPath) {
                if (substr($childPath, 0, $length) === $oldPath) {
                    $newChildPath = $newPath . substr($childPath, $length);
                    $this->at($newChildPath, $this->at($childPath));
                    $this->at($childPath, null);
                }
            }
        }
        $this->at($oldPath, null);
        return true;
    }
1212862
public function rename($oldName, $newName)
    {
        if (null !== $this->collection->get($newName)) {
            throw new RuntimeException(
                sprintf(
                    'Could not rename toggle %1$s to %2$s, a toggle with name %2$s already exists',
                    $oldName,
                    $newName
                )
            );
        }

        $currentToggle = $this->collection->get($oldName);

        if (null === $currentToggle) {
            throw new RuntimeException(
                sprintf(
                    'Could not rename toggle %1$s to %2$s, toggle with name %1$s does not exists',
                    $oldName,
                    $newName
                )
            );
        }

        $currentToggle->rename($newName);

        if (false === $this->add($currentToggle)) {
            throw new RuntimeException(
                sprintf(
                    'Failed to rename toggle %1$s to %2$s, an error occurred when saving toggle with new name',
                    $oldName,
                    $newName
                )
            );
        }

        return $this->remove($oldName);
    }
1365687
public function renameFile($name, $newName)
    {
        foreach ($this->getAllFields() as $field) {
            $path = $this->getFilePath($field, $name);
            $newPath = $this->getFilePath($field, $newName);
            if (file_exists($newPath)) {
                throw new \Exception("File {$newName} already exists");
            }
            rename($path, $newPath);
        }
        if ($name == $this->owner->getAttribute($this->fileField)
            && ($files = $this->getFileList())
        ) {
            $this->owner->updateAttributes([$this->fileField => $newName]);
        }
        return true;
    }
576762
public function rename($old_name, $new_name)
    {
        if (null === $this->_sftp_resource) {
            throw new TransportException(sprintf('None SSH connection available.'));
        }

        $old_name = $this->_getAbsoluteRemotePath($old_name);
        $new_name = $this->_getAbsoluteRemotePath($new_name);

        if (false === @ssh2_sftp_stat($this->_sftp_resource, $old_name)) {
            return $this->_trigger_error(sprintf('Could not open remote file: %s.', $old_name));
        }

        if (false !== @ssh2_sftp_stat($this->_sftp_resource, $new_name)) {
            return $this->_trigger_error(sprintf('Remote file already exists: %s.', $new_name));
        }

        if (false === @ssh2_sftp_rename($this->_sftp_resource, $old_name, $new_name)) {
            return $this->_trigger_error(sprintf('Unable to rename %s to %s', $old_name, $new_name));
        }

        return true;
    }
748424
public function rename_mbox($old, $new){
    if ( $this->is_connected() ){
      return imap_renamemailbox($this->stream, $this->mbParam. $old, $this->mbParam. $new);
    }
    return false;
  }
608210
public function rename($remote_file_path, $new_remote_file_path)
    {
        //get file string massage
        $remote_file_path = self::winslashes($remote_file_path);
    $new_remote_file_path = self::winslashes($new_remote_file_path);
    $this->execute('rename "'.$remote_file_path.'" "'.$new_remote_file_path.'"', $output);
    return $output;
    }