cmp: a pedestrian yet very fast file comparator
by us
10 Apr 2007
(Updated 11 Apr 2007)
CMP compares two files byte by byte
|
Watch this File
|
| File Information |
| Description |
CMP compares two files byte by byte employing a speed and memory optimized engine.
if the files do not match, CMP prints/returns the position and the numerical and ASCII character representation of the first differing byte and its ten neighbors.
performance:
% create a file with 80 megabytes of random data
fnam='cmp_test.mat';
tmat=rand(1,10*2^20);
save(fnam,'tmat');
clear tmat;
tic;
r=cmp(fnam,fnam,'-b','-s');
toc
delete(fnam);
% wintel systems:
% 1) p5/1.6ghz/512mb/win2k/r2007a
% > elapsed time = 3.7021 seconds
% 2) p5/2.6ghz/512mb/winxp/r2007a
% > elapsed time = 2.1013 seconds
% 3) c2.2*2.4ghz/2gb/winvista/r2007a
% > elapsed time = 1.0190 seconds
see
> help cmp
and the screen shot for more information about this self-explanatory snippet and its few options. |
| MATLAB release |
MATLAB 7 (R14)
|
| Other requirements |
good spirits! |
|
Tags for This File
|
| Everyone's Tags |
|
| Tags I've Applied |
|
| Add New Tags |
Please login to tag files.
|
| Comments and Ratings (4) |
| 17 Apr 2007 |
x y
|
|
|
| 17 Apr 2007 |
urs (us) schwarz
|
|
|
| 17 Apr 2007 |
John D'Errico
|
|
|
| 10 Jul 2007 |
Ali OZGUL
|
|
|
|
Contact us at files@mathworks.com