Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

[v32] "ZIP /U /R" does also update files which are NEWER than files on disk

Jan
687
16
In help for ZIP

ZIP - Add, update, or delete files in a .ZIP archive
/UUpdate files which either don't exist in the zip, or which are older than the files on disk.

But a "ZIP /U /R" does also update files which are newer than files on disk.
 
Create a test scenario as following:

Code:
ag-usr@LAPTOP-C760CBHO >["d:\"]
ADM: N | Zeit: 16:23 | $ del /q testzip.zip
TCC: (Sys) Das System kann die angegebene Datei nicht finden.
 "D:\testzip.zip"

ag-usr@LAPTOP-C760CBHO >["d:\"]
ADM: N | Zeit: 16:23 | $ rd /s /q testzip
TCC: (Sys) Der Verzeichnisname ist ungültig.
 "D:\testzip"

ag-usr@LAPTOP-C760CBHO >["d:\"]
ADM: N | Zeit: 16:23 | $ md testzip

ag-usr@LAPTOP-C760CBHO >["d:\"]
ADM: N | Zeit: 16:23 | $ touch /c testzip\test1.txt
09.04.2024 16:23:59.369  D:\testzip\test1.txt

ag-usr@LAPTOP-C760CBHO >["d:\"]
ADM: N | Zeit: 16:23 | $ zip /r /u testzip.zip testzip
<= D:\testzip\*

ag-usr@LAPTOP-C760CBHO >["d:\"]
ADM: N | Zeit: 16:24 | $ zip /v testzip.zip
2024-04-09  14:23              1  100%  testzip\
2024-04-09  14:23              1 -100%  testzip\test1.txt

ag-usr@LAPTOP-C760CBHO >["d:\"]
ADM: N | Zeit: 16:24 | $

Now EDIT the test1.txt within zip directly and "repack" it (made that with Notepad+ and write string "test" on the 1st line) ...

Then it looks so:

Code:
ag-usr@LAPTOP-C760CBHO >["d:\"]
ADM: N | Zeit: 16:24 | $ zip /v testzip.zip
2024-04-09  14:23              1  100%  testzip\
2024-04-09  14:28              4  -50%  testzip\test1.txt

ag-usr@LAPTOP-C760CBHO >["d:\"]
ADM: N | Zeit: 16:28 | $

You can see, the edited file is now NEWER then the file on disk.

Now repeat the zip packing command again and check the zip:

Code:
ag-usr@LAPTOP-C760CBHO >["d:\"]
ADM: N | Zeit: 16:28 | $ zip /r /u testzip.zip testzip
<= D:\testzip

ag-usr@LAPTOP-C760CBHO >["d:\"]
ADM: N | Zeit: 16:29 | $ zip /v testzip.zip
2024-04-09  14:23              1  100%  testzip\
2024-04-09  14:23              1 -100%  testzip\test1.txt

ag-usr@LAPTOP-C760CBHO >["d:\"]
ADM: N | Zeit: 16:30 | $

Now - the NEWER file were replaced through the older one, which is wrong.
 

Similar threads

Back
Top