Page 1 of 1

commandline and binary files

Posted: Thu Jul 10, 2008 6:14 am
by bmerkle
Hi there,

I want to exclude binary files from a comparison (or from the comparison result)
I there a command line option to exclude binary files fomr a comparison or comparison result ?

Also second question: on the GUI I get a notification when comparing binaries.
Is there a commandline option to detect that this would result in a binary diff and abort ?

there are some settings in the config file (e.g. Binary=0) so it must be possible somehow...

thanks,
Bernhard.

Re: commandline and binary files

Posted: Thu Jul 10, 2008 8:11 am
by psguru
I want to exclude binary files from a comparison (or from the comparison result) I there a command line option to exclude binary files fomr a comparison or comparison result ?
If you are talking about directory comparison, then no, you can't exclude binary files (unless you know their extension, then you can add them to the exclude filer).
Also second question: on the GUI I get a notification when comparing binaries. Is there a commandline option to detect that this would result in a binary diff and abort ?
I'm not sure what you mean by "result in a binary diff and abort".

Re: commandline and binary files

Posted: Thu Jul 10, 2008 9:28 am
by bmerkle
psguru wrote: I'm not sure what you mean by "result in a binary diff and abort".
I would like to detect if it is a binary comparison and then cancel this or just report as "binary files differ".
Thats all. On the GUI this is working (a separate dialog comes up and i can cancel).
On the commandline i am unable to detect this and specify this behaviour.
Can you please add a corresponding option ? I think internally there is one in the config file but not on the command line.

As I reported in another post, this leads to serious problems (examdiff.com crashed) when you try to compare directories with files that are binaries. I do not know all the binary extensions in advance unfortunately.

hope this explains my problems...
thanks,
Berni.

Re: commandline and binary files

Posted: Thu Jul 10, 2008 9:56 am
by psguru
I would like to detect if it is a binary comparison and then cancel this or just report as "binary files differ".
Thats all. On the GUI this is working (a separate dialog comes up and i can cancel).
On the commandline i am unable to detect this and specify this behaviour.
Can you please add a corresponding option ? I think internally there is one in the config file but not on the command line.
The same option controls both GUI and command line output: Options | Misc | Messages | "Message about different binary files". When it's checked, the following output happens:

Code: Select all

C:\ExamDiff>examdiff "C:\Test\Bin 1\Control.dll" "C:\Test\Bin 2\Control.dll" /o:-
Different binary files: C:\Test\Bin 1\Control.dll, C:\Test\Bin 2\Control.dll
As I reported in another post, this leads to serious problems (examdiff.com crashed) when you try to compare directories with files that are binaries. I do not know all the binary extensions in advance unfortunately.
I don't believe this is still a problem. Our users (including myself) routinely compare directories that contain binary files.

Re: commandline and binary files

Posted: Thu Jul 10, 2008 9:44 pm
by bmerkle
psguru wrote: The same option controls both GUI and command line output: Options | Misc | Messages | "Message about different binary files". When it's checked, the following output happens:
but not when comparing directories.
when comparing with your approach have to know in _advance_ if its binary or not,
because I have _always_ /html on the command line when comparing.

Or I have to do this in _two_ steps and repeat the process, first without /html to find out
whether binary or not, and then in the second step with /html for those files which are not binary.

you see my point ? or am i missing something ?

thanks, Bernhard.

Re: commandline and binary files

Posted: Fri Jul 11, 2008 6:15 am
by psguru
I'm afraid I don't. What exactly is your command line? What kind of problems are you getting when you are using it?

Re: commandline and binary files

Posted: Fri Jul 11, 2008 6:20 am
by psguru
Looks like I didn't see your other post:
when i run examdiff.com on binary files with /o /html it crashes on binary files (result set is too large)
how can I avoid to compare binary files ? I do NOT know the file extensions in advance in general.
Let me look into this.

Re: commandline and binary files

Posted: Fri Jul 11, 2008 8:36 am
by psguru
I can't reproduce your problem. Even if you use "Full file comparison" under Options | Dir Comparison, binary files are only compared to determine that they are different or identical, and only a small buffer at a time. The only possibility I can see here is that you force binary files to be compared as text files under Options | Compare.

Re: commandline and binary files

Posted: Sun Jul 13, 2008 11:41 pm
by bmerkle
The problem is as follows:

I compare recursively two directories on the commandline. They contain both txt and binary files, I do not know the extensions of any binary in advance. The aim is to generate a html diff report for each file (except binaries).

Now to solve this problem I first do a examdiff.com /o:statusreport.txt
I then have the statusreport.txt for each file which is different but I do NOT have the information if it is binary or not. !

In a second step I do a diff for each of the files of statusreport.txt which had the line "Different files ->" in this report.
But in this second step I have to do the diff TWICE, as I do not know if the file is binary or not, and as I said I had some crashes with examdiff.com /html on binary files. So I do
A2. a examdiff.com /o:fileresult.txt on each file to find out if it is binary or not.
in a second step I do the same
B2. a examdiff.com /o:"+fullpathReportFile+" /html" on the text only file.
For the binaries found out in A1 i only do a small report that the binaries differ.

So this explains my algorithm, and the main drawback with examdiff.com is that i have to do the actuall diff twice in the second step, as in the first step (diff on directories, I do not get the information if the file is text or binary).
Hence I have to do a diff TWICE on each file, first to find out if it is binary and then do the diff with /html if it is not.

I have a solution now which is similar to the unix "file" command (which give information about text or binary) but I think it would be an improvement for examdiff.com if it could report this as well during directory comparison.

thanks,
Bernhard.

Re: commandline and binary files

Posted: Mon Jul 14, 2008 10:17 am
by psguru
as I said I had some crashes with examdiff.com /html on binary files
I'd need a reproducible scenario for this. Is it happening in 4.0?

I see your problem now. The best solution for you would be implementing one feature on the wish list ("Create directory comparison HTML diff report with links to file comparison HTML diff reports") but we currently are not planning to do so in the next version. Perhaps our plans will change though.

I think your current solution is the best you can do today. I can imagine a batch file that would iterate through the results of the directory comparison and, with the help of the "file" command produce HTML outputs for each pair of different files.

Re: commandline and binary files

Posted: Mon Jul 14, 2008 9:59 pm
by bmerkle
it is reproduceable with 4.0 and I sent you a testcase via gmail.

thanks,
Bernhard.