1

For example i have files in three folders:

+-------------------+---------------------------------+-------------+
|     Folder1       |           Folder2               |   Patches   |
+-------------------+---------------------------------+-------------+
| - OldFile1.bin    |  - OldFile1.bin (Not Modified)  |             |
| - OldFile2.bin    |  - NewFile2.bin (Modified)      |             |
| - OldFile3.bin    |  - OldFile3.bin (Not Modified)  |             |
| - ........        |  - .........                    |             |
| - OldFileN.bin    |  - OldFileN.bin (Modified)      |             |
+-------------------+---------------------------------+-------------+

Then i wanna create patches for all modified files using xDelta:

FOR %%P in (Folder1\*.bin) do (
call xdelta.exe -9 -e -s "Folder1\%%~nP" "Folder2\%%~nP" "Patches\%%~nP.xdelta"
)

In Patches folder i get all files from Folder1 with 0kb size which wasnt modified. How to ignore them?

In docs nothing says about hash or another file checking.

1 Answers1

2

You can test if there is any modification before generating the patch

FOR %%P in ("Folder1\*.bin") do (
    fc /b "Folder1\%%~nxP" "Folder2\%%~nxP" >nul 2>&1 ||  xdelta.exe -9 -e -s "Folder1\%%~nxP" "Folder2\%%~nxP" "Patches\%%~nP.xdelta"
)
MC ND
  • 69,615
  • 8
  • 84
  • 126