Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
dcmp --sync option #42
@adammoody Okay, thank you. I was looking through it again in totalview, and it does find the number of files in the destination that don't exist in the source, but it does so after the call to dcmp_strmap_compare in main. It is on the call to dcmp_outputs_write that it finds this info, and prints it to the console. It is in dcmp_output_write. I could move all of the remove/sync logic to after the dcmp_stramp_compare function completes?
changed the title from
added sync option that removes files only in dst list
--sync option in dcmp
Jun 1, 2017
There are two things here I'm thinking about.
First, in the case that we hit an error when trying to compare the content of two files, we return -1. We then use that return value in the segmented scan, which is really set up to expect 0 or 1. I think it may still do the right thing with -1, but I think we should update the code to check the return value and use 1 in case 0 is not returned.
Second, a bigger issue is that I think we may not do the right thing if the source and destination files are different, but we hit an error when opening/seeking. In this case, we probably will detect the difference, but we'll have bailed out from the function when we should have copied over the destination file with the source data. So we may report the files as being different, but the sync won't have fixed them. If this is true, we should probably make sure the tool really reports an error here.
I'll work on these today.