PHP file_exists但重命名失败“没有这样的文件或目录……”?
发布时间:2020-12-13 22:04:59 所属栏目:PHP教程 来源:网络整理
导读:有问题的文件的思考创建滞后于违规功能,我尝试运行一个while循环来购买一段时间再调用重命名. $no_file = 1; while($no_file $no_file 300){ // generation of Worksheet.xls may lag behind function -- WAIT FOR IT if(file_exists($old_path)) { $no_file
有问题的文件的思考创建滞后于违规功能,我尝试运行一个while循环来购买一段时间再调用重命名.
$no_file = 1; while($no_file && $no_file < 300) { // generation of Worksheet.xls may lag behind function -- WAIT FOR IT if(file_exists($old_path)) { $no_file = 0; rename($old_path,$new_path); } else $no_file++; } if($no_file) die("Error: Worksheet.xls not found"); 在这个配置中,我认为只有在file_exists()返回true时才能调用rename(),但是对于我的生活,我无法弄清楚如何/为什么然后调用rename()然后返回失败…
解决方法
它可能告诉你语句/ TESTING / 2012 /不存在.使用
mkdir() 创建这些目录,以便能够保存文件.
mkdir( 'C:wampwwwdemox/wp-content/plugins/cat-man/store-manager/summary/statements/TESTING/2012/',777,true); (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |