【解決方法】警告: stat(): PHP のファイルサイズの stat が失敗しました

プログラミングQA


私のコード:

PHP
<?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\FileManager\index.php の 31 行目で、index.tpl の stat が失敗しました。

1905 拡張:tpl
警告: stat(): C:\xampp-portable\htdocs\FileManager\index.php の 31 行目で、license.txt の stat が失敗しました。

432 拡張子:txt
警告: stat(): C:\xampp-portable\htdocs\FileManager\index.php の php.ini の 31 行目で stat が失敗しました

79095 拡張子:これ
警告: stat(): C:\xampp-portable\htdocs\FileManager\index.php の 31 行目で rmagick-2.13.1.gem の stat が失敗しました

1300992 拡張機能:gem
警告: stat(): C:\xampp-portable\htdocs\FileManager\index.php の 31 行目で Wildlife.wmv の stat が失敗しました

26246026 拡張子:wmv

この警告メッセージを停止したいのですが、どうすればよいですか? 解決策を教えてください…

コメント

タイトルとURLをコピーしました