MaCgyver Posted August 31, 2006 Share Posted August 31, 2006 I wrote the following script to compare the modified times of two files. If the csv file has a great modified date/time than it will call another script. However their maybe lag time between the two files getting their modified times. The CSV file may have a modited date/time that is greater than the LOG file by one minute. I want to make so that the script calls the 2nd script only if the CSV file modified date/time is greater by 5 minutes over the LOG file. ;The array is a single dimension array containing six elements: ;$array[0]= year (four digits) ;$array[1] = month (range 01 - 12) ;$array[2] = day (range 01 - 31) ;$array[3] = hour (range 00 - 23) ;$array[4] = min (range 00 - 59) $tlog = FileGetTime("\\sv000bktrade\apps\transend\logs\gldaily.log") $tcsv = FileGetTime("\\sv000bktrade\apps\transend\gldaily.csv") If $tcsv[0]&$tcsv[1]&$tcsv[2]&$tcsv[3]&$tcsv[4] > $tlog[0]&$tlog[1]&$tlog[2]&$tlog[3]&$tlog[4] Then MsgBox (16,"Transend Upload In Progress","Do Not Use This PC.",10) MsgBox (16,"Transend Upload In Progress","Wait for the ->Completed<- box to appear.",10) Run ("c:\transend\BTtransend.exe") EndIf Link to comment Share on other sites More sharing options...
ChrisL Posted August 31, 2006 Share Posted August 31, 2006 You need to look at the function _DateDiff () in the help file You can pass it the 2 dates and get a difference, if the dateDiff is greater than or equal to 5 minutes then do your stuff [u]Scripts[/u]Minimize gui to systray _ Fail safe source recoveryMsgbox UDF _ _procwatch() Stop your app from being closedLicensed/Trial software system _ Buffering Hotkeys_SQL.au3 ADODB.Connection _ Search 2d Arrays_SplashTextWithGraphicOn() _ Adjust Screen GammaTransparent Controls _ Eventlogs without the crap_GuiCtrlCreateFlash() _ Simple Interscript communication[u]Websites[/u]Curious Campers VW Hightops Lambert Plant Hire Link to comment Share on other sites More sharing options...
MaCgyver Posted August 31, 2006 Author Share Posted August 31, 2006 You need to look at the function _DateDiff () in the help fileYou can pass it the 2 dates and get a difference, if the dateDiff is greater than or equal to 5 minutes then do your stuffThanks! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now