Check if file is missing or old

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

To check if a file is missing or is older than specific number of
seconds, I did the following:

$infofile = "info.txt";
$infottl = 300;

if ( !file_exists($infofile) || (time()-filemtime($infofile)) >
$infottl ) {

  // Do something....


Something tells me that it's wrong and can lead to problems. Am I

Re: Check if file is missing or old

Jim Daloonik wrote:
Quoted text here. Click to load it

Why do you think it's wrong?

Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.

Site Timeline