Sign in to follow this  
Followers 0
MaCgyver

Help with File compare time

3 posts in this topic

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

Share this post


Link to post
Share on other sites



Share this post


Link to post
Share on other sites

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

Thanks!

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0