<?xml version="1.0" encoding="windows-1252"?>
<node id="688273" title="Re: File::Compare Binary Files" created="2008-05-24 07:18:38" updated="2008-05-24 03:18:38">
<type id="11">
note</type>
<author id="194370">
skx</author>
<data>
<field name="doctext">
&lt;p&gt;This is a suggestion of another method, rather than a comment on the module you mention.  When I want to compare (binary) files I do two things:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Use &lt;tt&gt;stat&lt;/tt&gt; to get the filesize.&lt;/li&gt;
&lt;li&gt;Use [cpan://Digest::SHA1] to get a checksum of the file contents.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Sure collisions are possible, but for my cases I find that if the SHA1 hash and file sizes match then the files are identical enough!&lt;/p&gt;
&lt;!-- Node text goes above. Div tags should contain sig only --&gt;
&lt;div class="pmsig"&gt;&lt;div class="pmsig-194370"&gt;
&lt;a href="http://www.steve.org.uk/"&gt;Steve&lt;/a&gt;&lt;br/&gt;
-- &lt;br/&gt;

&lt;/div&gt;&lt;/div&gt;</field>
<field name="root_node">
688232</field>
<field name="parent_node">
688232</field>
</data>
</node>
