我正在尝试在获取文件时将文件属性打印到表中,readdir()
但收到错误消息:
“警告:fileperms() [function.fileperms]: stat failed for 0.54322000 1352164273tunes.txt 在 C:\Users\Desktop\xampp\tybai5131displayBackups.php 第 24 行”
文件名很长,因为我使用它来命名它microtime()
对于每个功能,我都会遇到相同的错误,而不仅仅是fileperms()
这是我正在使用的 PHP 代码:
<table>
<tr><th>File Name</th><th>Owner ID</th><th>Permissions</th><th>File Size</th></tr>
<?php
//declare backup directory as a variable
$dirBackup = "backups/";
//check if backup directory exists
if(!is_dir($dirBackup)) {
//display error message if backup directory does not exist
print("You do not have a backup directory yet.");
} else {
//else open the directory for reading
$dirOpenedBackup = opendir($dirBackup);
while($backupFile = readdir($dirOpenedBackup)){
if($backupFile !== '.' && $backupFile !== '..'){
print("<tr><td><a href='backups/".$backupFile."'>" .$backupFile. "</a></td><td>".fileowner($backupFile)."</td><td>".fileperms($backupFile)."</td><td>".filesize($backupFile)."</td></tr>");
}
}
}//close !is_dir
?>
</table>
关于我可以做些什么来让它正常工作的任何想法?