내가 readdir()
로 파일을 가져 오는 동안 테이블에 파일 속성을 인쇄하려고하지만 오류 받고 있어요 :파일 속성을 읽기
"Warning: fileperms() [function.fileperms]: stat failed for 0.54322000 1352164273tunes.txt in C:\Users\Desktop\xampp\tybai5131displayBackups.php on line 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>
제대로 작동하려면 어떻게해야합니까?
오류를 반환하는 것은'fileperms()'인가 아니면'fileowner()'와'filesize()'만입니까? –