以下代码给我错误:“mkdir:file exists”。mkdir,file_exists:混淆和矛盾错误
$path = 'c://wamp/www/et1/other';
$new_location = 'c://wamp/www/et1/other/test';
if(file_exists($path) && is_dir($path))
{
if(!file_exists($new_location))
{
mkdir($new_location, 0777);
}
}
但是,如果我不放第二条件,它会给我错误:“mkdir:no such file or directory”。另外,如果我通过写入mkdir($ new_location,077,true)添加递归性,我不会收到错误,但目录不会被创建。我只是不明白我在这里可能会做错什么。
'$ path'和'$ new_location'是否有关?如果是这样,怎么样?如果不是,你为什么提到这两个? – Jon
您可以发布$ path和$ new_location的值吗? – Andrea
'mkdir($ new_location,0777,true);'假设'$ new_location'是'$ path。$ some_new_directory' –