大虾帮忙看看看这个代码有什么问题?
运行这个模块时,下面红字部分报错Warning: mkdir() [function.mkdir]: No such file or directory
/**
* 函数名称: createDir
* 函数功能: 创建文件夹
* 输入参数:
$root ---------------- 根路径
$type ---------------- 类型
* 函数返回值: 返回值说明
* 其它说明: 说明
*/
function createDir($root,$type)
{
if(!file_exists($root."/".$type))
{
$dir_arr = $root."/".$type;
if(mkdir($dir_arr)&&chmod($dir_arr,0777))
{
Return true;
}
else
{
Return false;
}
}
else
{
Return true;
}
}
------解决方案--------------------
if(!file_exists($root."/".$type)) //这里将!去掉
{
$dir_arr = $root."/".$type;
<br><font color="#e78608">------解决方案--------------------</font><br>bool mkdir ( string $pathname [, int $mode = 0777 [, bool $recursive = false [, resource $context ]]] )<br><br>带上mode,带上true,递归创建。 另外@抑制错误,检查mkdir返回值。 <div class="clear"></div>
每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号