Hello everyone,
In this topic
http://www.autoitscript.com/forum/topic/143676-list-files-in-folders-and-subfolders-quickly/
I found a code (Belini member) that searches files in a very fast
AutoIt
#include <String.au3> #include <Array.au3> #include <File.au3> #include <MsgBoxConstants.au3> global $listing $directory = @DesktopDir list($directory, 0) time() Func list($path = "", $counter = 0) $counter = 0 $path &= '\' Local $list_files = '', $file, $demand_file = FileFindFirstFile($path & '*') If $demand_file = -1 Then Return '' While 1 $file = FileFindNextFile($demand_file) If @error Then ExitLoop If @extended Then If $counter >= 10 Then ContinueLoop list($path & $file, $counter + 1 ) Else $listing &= $path & $file & "|" EndIf WEnd FileClose($demand_file) EndFunc func time() $listing = StringTrimRight($listing, 1) $listing = _StringExplode($listing, "|", 0) _ArraySort($listing) ;_ArrayDisplay($listing, "File") _FileCreate(@ScriptDir & "\result.txt") _FileWriteFromArray(@ScriptDir & "\result.txt",$listing) endfunc
I can not understand
the function
where add
FileSetTime
$FT_CREATED $FT_ACCESSED
$aTime_Mod = FileGetTime($sFile, $FT_MODIFIED) $aTime_Created = FileGetTime($sFile, $FT_CREATED) $aResult[$i][1] = $aTime_Mod[0] & "/" & $aTime_Mod[1] & "/" & $aTime_Mod[2] & " [" & $aTime_Mod[3] & ":" & $aTime_Mod[4] & ":" & $aTime_Mod[5] & "]" $aResult[$i][2] = $aTime_Created[0] & "/" & $aTime_Created[1] & "/" & $aTime_Created[2] & " [" & $aTime_Created[3] & ":" & $aTime_Created[4] & ":" & $aTime_Created[5] & "]"
I think that the right function is $list_files
maybe within FOR - NEXT?
thanks