IT/php

php stat — 파일에 대한 정보를 제공합니다.

조원태 2017. 1. 1. 22:51
반응형

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'];

?>

반응형