1762947 Members
2575 Online
108909 Solutions
New Discussion юеВ

mgdiff with zip files

 
Sachin Patel
Honored Contributor

mgdiff with zip files

Hi
I know mgdiff (or any diff) does not support zip file.
Can we write something that first unzip file1 and send to filedescripter x then unzip file2 send that to filedescripter y and run mgdiff on x & Y.
if so how?
Is photography a hobby or another way to spend $
2 REPLIES 2
spex
Honored Contributor

Re: mgdiff with zip files

If you're interested in specific differences between the files:

#!/bin/bash

mkdir /tmp/foo
unzip -qc f1.zip > /tmp/foo/f1
unzip -qc f2.zip > /tmp/foo/f2
diff /tmp/foo/f1 /tmp/foo/f2
rm -rf /tmp/foo

exit 0

If you just want to know whether the zip files themselves differ, 'diff' works just fine:

$ diff f1.zip f2.zip
Binary files f1.zip and f2.zip differ

PCS
Sachin Patel
Honored Contributor

Re: mgdiff with zip files

Hi Spex
That is what I finally did it yesterday.

checked size of both zip files. make sure I have enough space on /tmp. if so then zcat file to /tmp/diff.pid_1 and /tmp/diff_pid_2 then run mgdiff on both. once it is finished remove that tmp file. I also put trapper loop there so if someone try to use ctr-c it will remove temp file and exit.

Is photography a hobby or another way to spend $