Slight change to Edit | Compare

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
grindax

Re: Slight change to Edit | Compare

Post by grindax »

.
Last edited by grindax on 22 Jan 2016 23:00, edited 1 time in total.

Marco
Posts: 2354
Joined: 27 Jun 2011 15:20

Re: Slight change to Edit | Compare

Post by Marco »

Mmh, getting back to the topic of comparing files, I realize that the Compare... commands have smartness built in (they check file size first, and then a small chunk at the beginning and end of the file before going "brute force" bit-per-bit). What if such smartness was available via a scripting function too? Then multiple files could be compared at once, it would be trivial for a scripter setting up a foreach loop that aborts as soon as one file looks different from the other scanned.
AFAICS, there's not a filecompare() function. And comparing hashes is not exactly the same thing, due to (un/likely) collisions.
Tag Backup - SimpleUpdater - XYplorer Messenger - The Unofficial XYplorer Archive - Everything in XYplorer
Don sees all [cit. from viewtopic.php?p=124094#p124094]

admin
Site Admin
Posts: 66366
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: Slight change to Edit | Compare

Post by admin »

Marco wrote:Mmh, getting back to the topic of comparing files, I realize that the Compare... commands have smartness built in (they check file size first, and then a small chunk at the beginning and end of the file before going "brute force" bit-per-bit). What if such smartness was available via a scripting function too? Then multiple files could be compared at once, it would be trivial for a scripter setting up a foreach loop that aborts as soon as one file looks different from the other scanned.
AFAICS, there's not a filecompare() function. And comparing hashes is not exactly the same thing, due to (un/likely) collisions.
The code is already there (since 20110321 :) ) but I had no time to dcoument it.

Code: Select all

comparefiles(file1, file2, [hash])
I look over it for glitches now...

Post Reply