Search the Community
Showing results for tags 'modification'.
-
I am trying to dynamically get folders and their modification date, I was orientated by this: ; Initial Launch, grab current GetTime $file1_1 = FileGetTime("X:\aescripts\testimg", 0, 1) Timecheck() Func Timecheck() $file1_2 = FileGetTime("X:\test\testimg", 0, 1) If $file1_1 == $file1_2 Then ConsoleWrite("Folder 1 not modified" & @CRLF); ElseIf $file1_1 <> $file1_2 Then ConsoleWrite("Folder 1 modified" & @CRLF) EndIf ; Initial Launch, grab current GetTime $file1_1 = FileGetTime("X:\test\testimg", 0, 1) EndFunc ; Initial Launch, grab current GetTime $file1_1 = FileGetTime("X:\test\testimg", 0, 1) While 1 Sleep(5000) Timecheck() WEnd That works, but it is not dynamic. So I did code following but it does not work properly. Local $sFootage_01 = "Z:\Footage\ClothImgs\" Local $aFileListFootageFolder_01 = _FileListToArray($sFootage_01, "*") ; Initial Launch, grab current GetTime For $i = 0 To UBound($aFileListFootageFolder_01) - 1 $newFootageFolder_01 = $sFootage_01 & $aFileListFootageFolder_01[$i] $getTimeNewFootageFolderInit_01 = FileGetTime($newFootageFolder_01, 0, 1) ConsoleWrite("First Filename " & $newFootageFolder_01 & @CRLF) Next Func Timecheck() Local $aFileListFootageFolderRe_01 = _FileListToArray($sFootage_01, "*") If @error = 1 Then ConsoleWrite("not valid path" & @CRLF) Exit EndIf If @error = 4 Then ConsoleWrite("could not find any data" & @CRLF) Exit EndIf For $i = 0 To UBound($aFileListFootageFolderRe_01) - 1 $newFootageFolder_01 = $sFootage_01 & $aFileListFootageFolderRe_01[$i] ConsoleWrite("ArrH " & $aFileListFootageFolderRe_01[$i] & @CRLF) $getTimeNewFootageFolder_01 = FileGetTime($newFootageFolder_01, 0, 1) ConsoleWrite("ZZZ First Filename " & $newFootageFolder_01 & @CRLF) Local $aGetTimeNewFootageFolder_01 = _FileListToArray($newFootageFolder_01, "*") For $u = 0 To UBound($aGetTimeNewFootageFolder_01) -1 If $getTimeNewFootageFolderInit_01 == $getTimeNewFootageFolder_01 Then ConsoleWrite($newFootageFolder_01 & " has not been changed" & @CRLF) ElseIf($getTimeNewFootageFolderInit_01 <> $getTimeNewFootageFolder_01 And $aGetTimeNewFootageFolder_01[0] == 11) Then ConsoleWrite("File 1 has been changed and has " & $aGetTimeNewFootageFolder_01[0] & " images" & @CRLF) ConsoleWrite("Time 1.1: " & $getTimeNewFootageFolderInit_01 & @CRLF & "1.2: " & $getTimeNewFootageFolder_01 & @CRLF) WinKill($hWnd, "") Sleep(8000) RunCm() ListFolders() ExitLoop ElseIf($getTimeNewFootageFolderInit_01 <> $getTimeNewFootageFolder_01 And $aGetTimeNewFootageFolder_01[0] <> 11) Then ConsoleWrite("Path " & $newFootageFolder_01 & " modification date has changed, number of images: " & $aGetTimeNewFootageFolder_01[0] & " files/folders" & @CRLF) Else ConsoleWrite("Else Statement" & @CRLF) EndIf Next Next $aFileListFootageFolderInit_01 = _FileListToArray($sFootage_01, "*") ; Initial Launch, grab current GetTime For $i = 0 To UBound($aFileListFootageFolder_01) - 1 $newFootageFolder_01 = $sFootage_01 & $aFileListFootageFolder_01[$i] $getTimeNewFootageFolderInit_01 = FileGetTime($newFootageFolder_01, 0, 1) Next EndFunc $aFileListFootageFolderInit_01 = _FileListToArray($sFootage_01, "*") ; Initial Launch, grab current GetTime For $i = 0 To UBound($aFileListFootageFolder_01) - 1 $newFootageFolder_01 = $sFootage_01 & $aFileListFootageFolder_01[$i] $getTimeNewFootageFolderInit_01 = FileGetTime($newFootageFolder_01, 0, 1) Next ; check every 5s if files in footage folder has been changed While 1 Sleep(5000) ConsoleWrite("While Loop " & @CRLF) Timecheck() WEndIt always goes to the first ElseIf Statement and tells me that the files have been changed. So I printed out the modification dates and this varaible shows correctly the current modification date of the subfolder $getTimeNewFootageFolder_01 and this $getTimeNewFootageFolder_01 does show another modification date of another folder which I do not understand. Again the code (not dynmaic one) above works, but trying to make it dynmacly did not work.
-
Whats is the best method to know if a specific folder has changed his files. In my case I want to check if pictures in my folder have been changed or not. (If someone is interest in future plans I want to count afterwards the files in that folder, but that is not important now) Can anyone help me out, I though of something like getting the current modification date and comparing it somehow with the future one but I do not know if something like that is even possible. SO basically again I "Just" want to check if a specific folder ( files in that folder) have been changed.
- 1 reply
-
- modification
- folder
-
(and 2 more)
Tagged with:
-
I'm using ftp functions but the modification time always have 0 seconds. Is it how it should work? I checked in FileZilla and it returns seconds.
-
- ftp
- modification
-
(and 1 more)
Tagged with: