A Argo Lifer Apr 8, 2000 10,045 0 0 Mar 19, 2004 #1 Can somebody help me out with a perl script that would compare dates of 2 files. I know nothing about perl. Basically I need to do something like: if (file1 is newer than file2) { exit; }
Can somebody help me out with a perl script that would compare dates of 2 files. I know nothing about perl. Basically I need to do something like: if (file1 is newer than file2) { exit; }
M Mitzi Diamond Member Aug 22, 2001 3,775 1 76 Mar 19, 2004 #2 Depends what you mean by 'date' - modified date, creation date etc etc. Example: $name1 = "myfile.dat"; $name2 = "myotherfile.dat"; Modification age in days: if (-M $name1 > $name2) Access age in days: if (-A $name1 > $name2)
Depends what you mean by 'date' - modified date, creation date etc etc. Example: $name1 = "myfile.dat"; $name2 = "myotherfile.dat"; Modification age in days: if (-M $name1 > $name2) Access age in days: if (-A $name1 > $name2)