警告:stat():stat在php中的文件大小失败 [英] Warning: stat(): stat failed for filesize in php
本文介绍了警告:stat():stat在php中的文件大小失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我的代码:
My Code:
<?php
$filesize;
$ext;
$dir = "video/";
echo '<br>';
// Open a known directory, and proceed to read its contents
if (is_dir($dir)) {
if ($dh = opendir($dir)) {
while (($file = readdir($dh)) !== false) {
//echo "filename: $file :<br> filetype: " . filetype($dir . $file) . "\n";
$sizeoffile = @filesize("video/".$file);
$ext = pathinfo($file, PATHINFO_EXTENSION);
stat(iconv('UTF-8', 'ISO-8859-1', $file));
echo '<br>'.$sizeoffile ." extention:".$ext;
}
closedir($dh);
}
}
echo '<br>';
?>
输出:
0延伸:
0延伸:
警告:stat():对于C:\ xampp-portable\htdocs中的index.tpl,stat失败第31行\\FileManager \ index.php
1905 extention:tpl
警告:stat():stat.txt失败在C:\ xampp-portable\htdocs \FileManager \ index.php第31行
432延期:txt
警告:第31行的C:\ xampp-portable \htdocs \FileManager \ index.php中的php.ini的stat():stat失败
79095 extention:ini
警告:stat():第31行的C:\ xampp-portable\htdocs \FileManager \ index.php中的rmagick-2.13.1.gem的stat失败
1300992 extention:gem
警告:stat():对于C:\ xampp-portable \中的Wildlife.wmv,stat失败第31行的htdocs \FileManager \ index.php
26246026延期:wmv
我想停止此警告信息我该怎么办?请给我一个解决方案......
推荐答案
filesize ;
filesize;
ext ;
ext;
dir = 视频/跨度>;
echo ' < br>'< /跨度>;
// 打开一个已知目录,然后继续阅读其内容
< span class =code-keyword> if (is_dir(
dir = "video/"; echo '<br>'; // Open a known directory, and proceed to read its contents if (is_dir(
这篇关于警告:stat():stat在php中的文件大小失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文