Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/wpf/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php filesize()[function.filesize]:中LinqBridge.dll的stat失败_Php_Function_Filesize_Stat - Fatal编程技术网

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

Php filesize()[function.filesize]:中LinqBridge.dll的stat失败,php,function,filesize,stat,Php,Function,Filesize,Stat,我编写一个脚本,使用此选项列出更新目录中的文件: 文件名文件哈希文件大小 为什么会出现此错误: Warning: filesize() [function.filesize]: stat failed for LinqBridge.dll in C:\xampp\htdocs\update.php on line 15 我的php代码: <?php if(isset($_GET['action']) and ($_GET['action']=="list")) {

我编写一个脚本,使用此选项列出更新目录中的文件:

文件名文件哈希文件大小

为什么会出现此错误:

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

<?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;";
}
 }
 }
  ?>

您在$dirArray中的文件位于不同的目录中。您是从“/Update/”读取它们的,因此,在执行文件大小、filectime、filemtime或wahtever其他操作时,您需要以“/Update/”作为前缀


运行此脚本的用户ID是否具有该文件的访问权限,您是否使用正确的路径访问该文件?是的,是的,我使用正确的路径谢谢您的工作。还有其他问题:我的主机中的文件名可能是Launcher[dot]exe,但我想在echo中显示它的真名:Launcher.exe可以吗?我不明白你的消息,请重新措辞并检查你的英语,它现在不可读…我有一些文件是多种格式的,比如.exe和.dll和.txt,但出于某种原因,我将格式.exe改为[dot]exe,在这个脚本结果(echo)中,[dot]exe没有显示为.exe,我希望它显示为.exe而不是[dot]exe。我这样做了:*如果(substr($dirArray[$index]”,0,1)!=“{$text=explode('[dot]“,$dirArray[$index]);echo$text[0];if(@$text[1]!=”)echo.。$text[1];echo@hash_file('md5',$dirArray[$index])。”;echo filesize(./Update/“$dirArray[$index]);**但现在文件哈希没有显示?!!echo str_替换('[dot]',“,$dirArray[$index]))
echo filesize("./Update/".$dirArray[$index])."&nbsp;";