我有一个名为 abc.txt 的文件,想要根据修改的日期和时间连续读取
我试过这样,但我想根据日期和时间的变化循环检查文件。
Global $file
func filess()
$search = FileFindFirstFile("abc.txt")
if @error Then
MsgBox(0, "error", "failed to find first file")
Exit
EndIf
While -1
$file = FileFindNextFile($search)
If @error Then ExitLoop
ConsoleWrite("File:" & $file & @CRLF)
$time = FileGetTime($file,0)
$dmyyyy = $time[3]& ":" & $time[4] & ":" & $time[5]&'_'&$time[2]& "/" & $time[1] & "/" & $time[0]
MsgBox(0, "Modify date and time of file", $dmyyyy)
if @error Then
ConsoleWrite("Error getting time from " & $file & @CRLF)
EndIf
WEnd
Return $file
EndFunc
; Close the search handle
$mss=filess()