doujiao2000
2012-06-21 19:10 阅读 41
已采纳

filesize()[function.filesize]:LinqBridge.dll中的stat失败

i write a script to list my file from Update directory with this option:

file-name file-hash file-size

why i get this error:

Warning: filesize() [function.filesize]: stat failed for LinqBridge.dll in      C:\xampp\htdocs\update.php on line 15

my php cod:

<?php
  if(isset($_GET['action']) and ($_GET['action']=="list"))
 {
    $myDirectory = opendir("./Update/");
    while($entryName = readdir($myDirectory)) {
$dirArray[] = $entryName;
 }
    closedir($myDirectory);
    $indexCount = count($dirArray);
    sort($dirArray);
   for($index=0; $index < $indexCount; $index++) {
    if (substr("$dirArray[$index]", 0, 1) != "."){
    echo $dirArray[$index]."&nbsp;";
    echo @hash_file('md5',$dirArray[$index])."&nbsp;";
    echo filesize($dirArray[$index])."&nbsp;";
}
 }
 }
  ?>
  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享

1条回答 默认 最新

  • 已采纳
    dongyuans61046 dongyuans61046 2012-06-21 19:15

    Your files in $dirArray are located in a different directory. You are reading them from "./Update/" thus when doing a filesize or filectime or filemtime or wahtever else, you need to prefix with "./Update/".

    echo filesize("./Update/".$dirArray[$index])."&nbsp;";
    
    点赞 评论 复制链接分享

相关推荐