选择语言 :

 Core_Ftp::rename

重命名或移动一个文件

bool Core_Ftp::rename( string $old_file , string $new_file [, bool $move = bool false ] )

参数列表

参数 类型 描述 默认值
$old_file string
$new_file string
$move bool bool false
返回值
  • bool
File: ./core/classes/ftp.class.php
public function rename($old_file, $new_file, $move = false)
{
	if (!$this->_is_conn())
	{
		return false;
	}

	$result = @ftp_rename($this->_conn_id, $old_file, $new_file);

	if (false===$result)
	{
		if (IS_DEBUG)
		{
			Core::debug()->error(__('ftp unable to ' . ($move === false ? 'rename' : 'move')));
		}
		return false;
	}

	return true;
}