Jump to content

Problem with FileGetTime (need to refresh directory to get value)

Recommended Posts

I have an APP that periodically writes logs to a logfile

And I wrote an autoit script that constantly observe this logfile's file timestamp using

local $date = FileGetTime( $HISTORYFILE, 0, 1 ) ;last modified, string format
            if @error=0 AND $_PrevDate<>$date then
                $_PrevDate = $date
                $TimeOut = TimerInit()


HOWEVER, I noticed that FileGetTime is not getting the correct result... BUt the moment I "refresh" the directory, it immediately gets the correct datetime.

What should I do??


Edited by Burgaud
Link to post
Share on other sites

I manage to make it all work by inserting

local $line = FileReadLine( $HISTORYFILE, -1 )
FileGetSize and FileGetDate now returns updated values..
now why must I need to do a read first?
Edited by Burgaud
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
  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...