运行这个模块时,下面红字部分报错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;
}
 }

解决方案 »

  1.   


    function createDir($root,$type,$dir_arr){……}
      

  2.   

    不好意思,看错了,将$dir_arr打出来看看:$dir_arr = $root."/".$type;
    echo "dir-->>".$dir_arr."<br>";exit;
      

  3.   

    #1楼看错了,将$dir_arr打出来看看:$dir_arr = $root."/".$type;
    print_r($dir_arr);exit;#如果是数组,必须选中其中一个元素
      

  4.   

    输出是../album/thumb,默认目录?,并不是我想要模块的那个目录啊
      

  5.   

    输出是../album/thumb,默认目录?,并不是我想要模块的那个目录啊
      

  6.   


    if(!file_exists($root."/".$type))  //这里将!去掉
    {
    $dir_arr = $root."/".$type;从这段代码看,楼主的$dir_arr更本就不存在啊?!!
      

  7.   

    bool mkdir ( string $pathname [, int $mode = 0777 [, bool $recursive = false [, resource $context ]]] )带上mode,带上true,递归创建。 另外@抑制错误,检查mkdir返回值。