Using this function on Win98 made me grow grey hair.
Win 98 doesn't save the time for the last access. It only saves the date. This way, the returned timestamp from fileatime(file) is always much too small.
this command will always return false:
if($now - $last_access >1800) {
do something
}
using filemtime() instead did the thing.
fileatime
(PHP 4, PHP 5)
fileatime — 최근에 파일에 접근한 시간을 가져옴
Description
int fileatime
( string $filename
)
파일에 최종 접근 시간을 반환하며 에러가 발생할 경우에는 FALSE를 반환합니다. 반환되는 시간은 유닉스형식입니다.
이 함수의 실행결과는 캐시가 됩니다. 좀 더 자세한 내용을 알고 싶다면 clearstatcache()를 보십시오.
주의: 파일에 접근한 시간은 파일을 읽어들인후에 접근이 막혔을 때마다 바뀌는 것이 지원됩니다.이렇게 하는 것은 정기적으로 매우 많은 파일이나 디렉토리에 어플리케이션에서 접근할 때 꽤 많은 자원을 요구합니다.몇몇 유닉스 시스템에서는 그런 어플리케이션의 퍼포먼스 증가를 막기 위해서 접근시간 업데이트 설정을 꺼놓고 마운트 하기도 합니다. USENET 뉴스 스풀이 일반적인 예입니다. 그런 파일시스템에는 이 함수는 별로 쓸모 없을것입니다.
fileatime
Maulwurf
10-Oct-2004 09:12
10-Oct-2004 09:12
