创建文件夹时出错

发布于 2024-09-03 09:50:35 字数 459 浏览 1 评论 0原文

我正在尝试创建这样的文件夹

$destination = "../folder_name/_pcode/../_compile";
mkdir($destination);

但这会出现错误

更新 我正在做的是,将 ../folder_name/_pcode 作为用户的输入,我想在 _pcode 目录之外创建一个文件夹

这是我的错误< /强>

Warning: mkdir() [function.mkdir]: No such file or directory in G:\wamp\www\tools\compile.php on line 57
../folder_name/_pcode/../_compile

I am trying to create folder like this

$destination = "../folder_name/_pcode/../_compile";
mkdir($destination);

But this gives error

UPDATE
What i am doing is, taking ../folder_name/_pcode as input from user and I want to create a folder outside the _pcode Directory

Here is my error

Warning: mkdir() [function.mkdir]: No such file or directory in G:\wamp\www\tools\compile.php on line 57
../folder_name/_pcode/../_compile

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

捎一片雪花 2024-09-10 09:50:35

您可能正在尝试在不存在的目录中创建子目录,在这种情况下,如果您想创建整个目录路径,请尝试设置 mkdir$recursive 参数设置为 true

mkdir($destination, 0777, true);

It is likely that you're trying to create a subdirectory within a non-existing directory, in this case, if you want to create the whole directory path, try setting mkdir's $recursive parameter to true:

mkdir($destination, 0777, true);
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文