반응형
stat — 파일에 대한 정보를 제공합니다.
설명 :
array stat ( string $filename )
filename에 의해 명명 된 파일의 통계를 수집합니다. filename이 심볼릭 링크 인 경우, 통계는 심볼 링크가 아닌 파일 자체의 것입니다.
lstat ()는 symlinks 상태를 기반으로하지 않는다는 점을 제외하고 stat ()와 동일합니다.
인수 :
filename
파일 경로.
오류/예외 :
실패하면 E_WARNING이 발생합니다.
예제 :
<?php
/* Get file stat */
$stat = stat('C:\php\php.exe');
/*
* Print file access time, this is the same
* as calling fileatime()
*/
echo 'Access time: ' . $stat['atime'];
/*
* Print file modification time, this is the
* same as calling filemtime()
*/
echo 'Modification time: ' . $stat['mtime'];
/* Print the device number */
echo 'Device number: ' . $stat['dev'];
?>
반응형
'IT > php' 카테고리의 다른 글
php filectime — 파일의 inode 변경 시간을 가져옵니다. (0) | 2017.01.02 |
---|---|
php filemtime — 파일 수정 시간 가져 오기 (0) | 2017.01.02 |
php lstat — 파일 또는 심볼릭 링크에 대한 정보를 제공합니다. (0) | 2017.01.01 |
php filesize — 파일 크기를 가져옵니다. (0) | 2017.01.01 |
php pclose — 프로세스 파일 포인터를 닫습니다. (0) | 2016.12.30 |