Comparing two large files
-
Hello, I am working on a function that displays the differences in two files. However, this can take minutes when the files are 1 MB or greater. is there a quick way to compare two files on a byte to byte basis and return the offset of the differing bytes and the bytes located there? Thanks.
-
Hello, I am working on a function that displays the differences in two files. However, this can take minutes when the files are 1 MB or greater. is there a quick way to compare two files on a byte to byte basis and return the offset of the differing bytes and the bytes located there? Thanks.
There's nothing that will do it for you, if that's what you're asking. I'd probably start by reading a good size block of each file into its own buffer, then compare what's in the buffers. Reading one byte at a time from each file and comparing will probably be the slowest way you can do it. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
-
There's nothing that will do it for you, if that's what you're asking. I'd probably start by reading a good size block of each file into its own buffer, then compare what's in the buffers. Reading one byte at a time from each file and comparing will probably be the slowest way you can do it. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome