Page 1 of 1

File Comparator FYI

Posted: 06 May 2010, 03:48
by therube
File Comparator - FYI

Just to point out that the Autodetect Files Type may not be the optimal choice - depending upon circumstances.

Like if you were comparing MP3s.
An MP3 would be Autodetected as a binary file.

WMP has a habit of playing with MP3 tags.
So what you may have archived away could end up being different from the same file once it has been played in WMP.

If you were to use Comparator using its' defaults, with the MP3s detected as binary, most likely, in this situation, you would not be presented with particularly relevant results. (Most likely the files would appear to be substantially different.)

However, having some idea that the change may be tag related, manually selecting Text File Type in Comparator would very clearly point out that the change was in fact tag related, with the actual changes to the file in fact being very minor.

Re: File Comparator FYI

Posted: 06 May 2010, 07:14
by Jan Patera
therube wrote:An MP3 would be Autodetected as a binary file.
That's of course correct.

Re: File Comparator FYI

Posted: 08 May 2010, 22:29
by mdruiter
Maybe therube means that it would be great if the File Comparator would only consider the changed part(s) during its file type detection. But that's a Catch-22 situation. :mrgreen:

Re: File Comparator FYI

Posted: 10 May 2010, 17:56
by therube
That's of course correct.
Correct.

it would be great if the File Comparator would only consider the changed part(s) during its file type detection
In a way, I guess you can say.

But that's my point. It cannot "know" the right method all the time. So, someone else may need to help it (File Comparator) out a bit ;-).

In my particular scenario, binary happens to be the correct choice based on file contents, but the comparison algorithm used for binary happens to be "incorrect" for the particular situation encountered. (The binary comparison algorithm is entirely correct, only when used here, it does not present pertinent data, thereby making it "incorrect", where a textual comparison will present data in a pertinent manner.)

Re: File Comparator FYI

Posted: 10 May 2010, 21:30
by mdruiter
The binary comparison algorithm is entirely correct
Yes.
But 'correct' is not a boolean. :-) The algorithm detecting file type is also 'correct'. But it's only making a guess. Probably according to a simple rule, such as "if it contains something weird, assume binary". My idea would be to improve this rule a bit, by considering Esc as "not so weird" (see http://forum.altap.cz/viewtopic.php?f=2&t=3945).
Of course no rule can ever be perfect. If it were, the choice between "automatic, text, binary" would not be necessary. So I guess we completely agree!