Note that there are some explanatory texts on larger screens.

plurals
  1. PONSFileManager contentsEqualAtPath:andPath: compare checksum data
    text
    copied!<p>Does the <code>NSFileManager</code> method <code>contentsEqualAtPath:andPath:</code> create a dynamic checksum to compare two files, does it open the file header and compare file header details or does it use some other method for comparing?</p> <p>I have a list of 200,000 or so files to compare where the local files are to be compared with the files on a remote server volume. The local files would have been copied from the remote server volume at some point in the past, and I will be walking the list of files to compare each and then copying over any newer files from the remote server volume to the local machine (overwriting any existing). There is no guarantee that the remote server files were created by the local user (and more than likely they would not have been).</p> <p>As the files are small (approx. 4K in size) a complex file compare operation might take almost as long as a copy operation.</p> <p>This operation could (conceivably but not likely) happen multiple times in a user session so I need to make sure that I am using the most efficient method for checking.</p> <p>The operation itself will run on a separate thread so I don't have issues of tying up the user while the operation completes.</p> <p>I've started the implementation to test this but was interested to see if anyone else has had any experience comparing thousands of files quickly in order to determine which files need updating if a newer one exists. And if you have, do you have any pointers or pitfalls to avoid?</p> <p>Any advice much appreciated.</p> <p><strong>Update</strong></p> <p>Thinking about this some more, it might be more beneficial to keep a file that tracks the last updated timestamp of any changed images and keep a local file that does the same and just compare those two documents... Will update more as I progress.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload