选择语言 :

 Core_Ftp::mkdir

创建一个目录

bool Core_Ftp::mkdir( [ string $path = empty , int $permissions = null ] )

参数列表

参数 类型 描述 默认值
$path string empty
$permissions int null
返回值
  • bool
File: ./core/classes/ftp.class.php
public function mkdir($path = '', $permissions = null)
{
	if ($path === '' || !$this->_is_conn())
	{
		return false;
	}

	$result = @ftp_mkdir($this->_conn_id, $path);

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

	// 设置目录权限
	if (!is_null($permissions))
	{
		$this->chmod($path, (int)$permissions);
	}

	return true;
}