Welcome to WebmasterWorld Guest from 54.167.157.247

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

Efficiently Comparing File Modification Dates

   
4:10 am on Jun 26, 2013 (gmt 0)

5+ Year Member Top Contributors Of The Month



My scripts constantly have to compare the modification dates of two files. To make the script work I have to clear my cache in PHP each time. Is there a more efficient way to compare file modification dates than this?

<?php
clearstatcache();
if(filemtime('file1.html') > filemtime('file2.html')){}
?>
7:47 am on Jun 26, 2013 (gmt 0)

WebmasterWorld Administrator phranque is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



Is there a more efficient way to compare file modification dates than this?

have you tried profiling this to see if it's actually a problem?

have you tried clearing the stat cache for the specific filenames to see if that improves anything significantly?
 

Featured Threads

Hot Threads This Week

Hot Threads This Month