无法打开目录:没有这样的文件或目录 [英] failed to open dir: No such file or directory

查看:128
本文介绍了无法打开目录:没有这样的文件或目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

$path= "/dropdown/";
 if(!is_dir($path))
 {
    echo "improper directory";
 }
 else
 {
    $zip = new ZipArchive;
    $zip->open('/file.zip', ZipArchive::CREATE);
if (false !== ($dir = opendir($path)))
     {
         while (false !== ($file = readdir($dir)))
         {
             if ($file != '.' && $file != '..')
             {
                       $zip->addFile($path.DIRECTORY_SEPARATOR.$file);

             }
         }
     }
     else
     {
         die('Can\'t read dir');
     }
$zip->close();





i打开目录,请给出建议打开目录

我正在ubuntu平台上运行php,为不同类型打开目录,

给出建议



i cant open the directory and please give suggestion for open the directory
and i am working php in ubuntu platform for different type open the directory,
give the suggestion

推荐答案

path = / dropdown /;
if(!is_dir(
path= "/dropdown/"; if(!is_dir(


path))
{
echo 不正确的目录;
}
其他
{
path)) { echo "improper directory"; } else {


zip = new ZipArchive;
zip = new ZipArchive;


这篇关于无法打开目录:没有这样的文件或目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆