Jump to content

Recommended Posts

Posted (edited)

what would be the best way to get the most recent created file

should i use _FilelisttoArray and do a FileGetTime in a loop? or is there a better way to accomplish this?

so far i have this, which works but think there is a better way to do it

$Log = _FileListToArray(@ScriptDir&"\Date")
    $yyyymmdd1 = 0
    $yyyymmdd2 = 0
    For $i = 1 to $Log[0]
        $aTime = FileGetTime(@ScriptDir&"\Date\"&$Log[$i], 1)
        If Not @error Then
            $yyyymmdd1 = $aTime[0] & $aTime[1] & $aTime[2]
            If $yyyymmdd1 > $yyyymmdd2 Then
                $yyyymmdd2 = $yyyymmdd1
                $Recent = $Log[$i]
            EndIf
        EndIf
    Next
Edited by d0n
  • 3 weeks later...

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...