Need an answer to a unix/linix question

teryhill wrote on Tuesday, August 04, 2015:

will this give me the date of the file in linix “date(“F d Y H:i:s.”,filemtime(“test.txt”));”
I am trying to remove a temp file that is X num of days old . I can do it in Windows but I don’t know if it will work on those other operating systems.

Thanks
Terry

visolveemr wrote on Tuesday, August 04, 2015:

Terry,

Yes the filemtime gives the file modification time, we have checked in linux. Further you can use below code which will give the X num of days after the file modified,

$diff = time()-filemtime("test.txt");
$days = round($diff/86400);

Thanks
OpenEMR Customization/Support Team,
ViSolve Inc
services@visolve.com | Phone: 408-850-2243
Demo’s @ ViSolve Demo Library

teryhill wrote on Tuesday, August 04, 2015:

So this will work

$chdate = date("Y-m-d");
 if (date("Y-m-d",filemtime($GLOBALS['OE_SITE_DIR']. "/edi/process_bills.log")) == $chdate) {
 
 Terry