FileComp
Dave Higton (1515) 3526 posts |
I have released a very fast file comparison app, FileComp. You can find it on my web site FileComp is designed to be very fast and to multi-task well, but it does not attempt to analyse differences between files. As such, it is most likely to be useful when you need to know “same” or “not same”, perhaps when you are checking for duplicate information (no point in saving multiple copies of the same thing in the same place), or that two copies of a backup are indeed identical, or that the new version of your software is still producing the same results as the old. It’s free, it’s released under the GPL, and I’m always interested to hear from people who’ve tried my stuff, for better or for worse! |
Chris Hall (132) 3554 posts |
How does it compare (ho ho) with !Cat? One option in that utility is to produce a 16 bit CRC of the first 4 Mbytes of each file. The resulting output can then be examined against a previous output (I use the DOS ‘fc’ utility) and the differences between those files will mark files that are either present in only one snapshot and not the other or files present in both that have different content. A similar comparison using just the file datestamp (i.e. without the CRC but with the two 32 bit ‘load’ and ‘execution’ addresses) will pick up files with the same content but with different datestamps. |
Colin (478) 2433 posts |
I don’t use !syslog so Filecomp didn’t work for me. I use diff. There’s a copy in the rom distributions in RiscOS.Library.GNU. I have a frontend for it !GDiff can’t remember where I got it – had it years. I’ve used it to list different files in 2 versions of rom sources. Seemed quite quick. |
Dave Higton (1515) 3526 posts |
@Chris: FileComp compares the whole files. It’s really simple – and it’s also really fast. @Colin: Thanks for the report. I looked at what the logs do, and it seemed so pointless that I simply removed it. (I’m sure I made more use of the logging facility while I was developing the app!) So the new version is on my web site now. |
Colin (478) 2433 posts |
It’s faster than diff. It does a 288MB file in 17.5 secs v 40 secs for diff. Dropping a directory on it gives an error as expected but the program then quits where I expected it to fail gracefully. |
Dave Higton (1515) 3526 posts |
John Williams has apprised me of a typo in the Help file, which I’ve updated (compleation → completion). If anyone downloads it now, you should get the new version. I’ve not changed the code, and so I haven’t upped the version number. Colin: thank you for pointing that one out. It hadn’t occurred to me. I’ll look at fixing that (which will cause me to increment its version number). I told you all it’s fast… |
Dave Higton (1515) 3526 posts |
Version 0.05 is on my web site now. This fixes the crash on attempting to compare directories. Thanks again for the report, Colin. |
Chris Hall (132) 3554 posts |
@Chris: FileComp compares the whole files. It’s really simple – and it’s also really fast. Ah! Cat was intended to compare a whole disc so that the files that had changed could be identified – for example after doing an OS upgrade. All it needed was an equivalent ‘snapshot’ of the disc taken before the upgrade. Then the two output files could be compared using ‘fc’. This would pick up files whose content had changed rather than just their datestamp |
Dave Higton (1515) 3526 posts |
I had an anxious moment yesterday. I had two 1MiB files that I wanted to compare. FileComp said they were identical and took 0.02 seconds to do it. I had to check it out by deliberately altering one byte near the end. It was indeed working correctly. Both files were in Ramfs and it’s a RasPi 3B+. Processing times are utterly dominated by the speed of the filing systems. |
Rick Murray (539) 13840 posts |
The most vivid example of this is building RISC OS on a Class 4 SD card, then upgrading to a Class 10 and noting that it is more than twice as fast. Then, on a modern machine, doing it all from RAMdisc where it literally flies. |
Frederick Bambrough (1372) 837 posts |
If you want really wizzy, try a class 10 A1 card. Swapped one into my BB -xM a couple of weeks ago and completely changed its personality. |