The sub below is the event raised when Archiver trys to unzip a file.
It seems that it detected a zip with an issue, could not unzip it - then it could not delete it - like the archiver still had a handle on it.
Log(" --- file did not pass unzip - delete it if we can: " & currdel)
delzip(currdel)
However - I looked at the file in question and it was perfectly vaid - unzipped just fine - and contents were in perfect order too.... aaarrrrgggg!
Since this ONE file kept hanging (could not delete it) - no other files (over 1800 of them) could not get processed.
I go to look at data - and it's not there - cause the files didn't get unzipped.
Anyone else have this issue - or suggestions on how to handle this problem? (move , rename, pull hair out even more?)...
Thx
EDIT:
Just recently (minutes ago) I found where archiver successfully unzipped the file, moved contents to desired folder - BUT COULD NOT DELETE IT!
Now the process go around in a loop - processing the same file since it still exists...
One thing I am trying is to Dim Archiver in the Globals - rather than each time in the sub...
If I close my app and restart it - the offending files get deleted properly - indicating to me that something had a hold (lock) on them....
End EDIT..
It seems that it detected a zip with an issue, could not unzip it - then it could not delete it - like the archiver still had a handle on it.
Log(" --- file did not pass unzip - delete it if we can: " & currdel)
delzip(currdel)
However - I looked at the file in question and it was perfectly vaid - unzipped just fine - and contents were in perfect order too.... aaarrrrgggg!
Since this ONE file kept hanging (could not delete it) - no other files (over 1800 of them) could not get processed.
I go to look at data - and it's not there - cause the files didn't get unzipped.
Anyone else have this issue - or suggestions on how to handle this problem? (move , rename, pull hair out even more?)...
Thx
EDIT:
Just recently (minutes ago) I found where archiver successfully unzipped the file, moved contents to desired folder - BUT COULD NOT DELETE IT!
Now the process go around in a loop - processing the same file since it still exists...
One thing I am trying is to Dim Archiver in the Globals - rather than each time in the sub...
If I close my app and restart it - the offending files get deleted properly - indicating to me that something had a hold (lock) on them....
End EDIT..
B4X:
Sub unzip_UnZipDone( err As Boolean, no As Int)
' handle file if needed
Log(ABMShared.CurrDT& " Unzipdone - completed without error? "&err& " num files:"&no )
If err = False Then
Log(" --- file did not pass unzip - delete it if we can: " & currdel)
delzip(currdel)
Return
End If
Wait For (File.CopyAsync(ecmFolder1,currdel,base_ecm&"/hist",currdel)) Complete (Success As Boolean)
'Log("file copy to hist Success: " & Success)
If Success Then
Log(" --- Did copy file to hist: " & currdel)
Else
Log(" --- Did not copy file due to copy failure: " & currdel)
End If
delzip(currdel)
End Sub