File comparison (byte, hash and meta) in C#
-
Background I'm working with a special type of "offline files"/"File sync"-system, and need to compare a users files on his/her computer en on the file server. The place I'm working at, was tricked by a Microsoft rep back in 2011, to use a system that works kind of like OneDrive. The user have their files on their laptop, and when connected to the organization's network, the files are synched with the file server The situation Now that they are migrating to Windows 10, and actual OneDrive, I've discovered a problem: the files aren't always synched. The process is now to run a set of tools on the users' computers,to check for errors, and if there is, (and there's plenty of errors), the user need to confirm which file is the correct one. The problem I've been testing WinMerge, and similar programs, but they are mostly garbage for the use I need them for. I need flexibility, meaning that i need complex filtering options, (e.g. folder names to increase processing speed), but also the options to look at files in different manners, (hashes of files, metadata, or byte-for-byte). THis could actually be done in powershell pretty "easily", however, the user will have to interact with this in a meaningfull and friendly way, so an interface is therefore needed, which allows for sorting, opening selected files, copying, copy to third party location, copy to same location with a pre/su-fix. Options to reduce timeconsumption, (quick mode which only checks metadata, or hashmode, which is in the middle, or slow mode byte-for-byte) My solution (thus far) Create this as a C# program, with a nice interface, (I've made the interface, and it's actually very nice), I've tested some simple file comparisons, but I need you guys' input. Am I doing this right or is there a piece of software that I haven't found yet?? Thanks for all input :-)
-
Background I'm working with a special type of "offline files"/"File sync"-system, and need to compare a users files on his/her computer en on the file server. The place I'm working at, was tricked by a Microsoft rep back in 2011, to use a system that works kind of like OneDrive. The user have their files on their laptop, and when connected to the organization's network, the files are synched with the file server The situation Now that they are migrating to Windows 10, and actual OneDrive, I've discovered a problem: the files aren't always synched. The process is now to run a set of tools on the users' computers,to check for errors, and if there is, (and there's plenty of errors), the user need to confirm which file is the correct one. The problem I've been testing WinMerge, and similar programs, but they are mostly garbage for the use I need them for. I need flexibility, meaning that i need complex filtering options, (e.g. folder names to increase processing speed), but also the options to look at files in different manners, (hashes of files, metadata, or byte-for-byte). THis could actually be done in powershell pretty "easily", however, the user will have to interact with this in a meaningfull and friendly way, so an interface is therefore needed, which allows for sorting, opening selected files, copying, copy to third party location, copy to same location with a pre/su-fix. Options to reduce timeconsumption, (quick mode which only checks metadata, or hashmode, which is in the middle, or slow mode byte-for-byte) My solution (thus far) Create this as a C# program, with a nice interface, (I've made the interface, and it's actually very nice), I've tested some simple file comparisons, but I need you guys' input. Am I doing this right or is there a piece of software that I haven't found yet?? Thanks for all input :-)
I wrote some software that did this back about 2010 and originally used the Sync Framework to do the work, but ended up hand rolling so much of my own code that there's very little original SF left in there. The approach I took was more than you'll need to do because you're looking at, effectively, a one time operation but my solution took care of client/server/server syncing - anyway, the crux of the checks - you check the file lengths first - if they are different, you don't need to do any further checking as you have a potential problem file; then you create a hash of both files, if they don't match, you have files that need checking. The vast majority of cases are caught by the file length as it's comparatively rare that you'll end up with different files that are the same size.
This space for rent
-
Background I'm working with a special type of "offline files"/"File sync"-system, and need to compare a users files on his/her computer en on the file server. The place I'm working at, was tricked by a Microsoft rep back in 2011, to use a system that works kind of like OneDrive. The user have their files on their laptop, and when connected to the organization's network, the files are synched with the file server The situation Now that they are migrating to Windows 10, and actual OneDrive, I've discovered a problem: the files aren't always synched. The process is now to run a set of tools on the users' computers,to check for errors, and if there is, (and there's plenty of errors), the user need to confirm which file is the correct one. The problem I've been testing WinMerge, and similar programs, but they are mostly garbage for the use I need them for. I need flexibility, meaning that i need complex filtering options, (e.g. folder names to increase processing speed), but also the options to look at files in different manners, (hashes of files, metadata, or byte-for-byte). THis could actually be done in powershell pretty "easily", however, the user will have to interact with this in a meaningfull and friendly way, so an interface is therefore needed, which allows for sorting, opening selected files, copying, copy to third party location, copy to same location with a pre/su-fix. Options to reduce timeconsumption, (quick mode which only checks metadata, or hashmode, which is in the middle, or slow mode byte-for-byte) My solution (thus far) Create this as a C# program, with a nice interface, (I've made the interface, and it's actually very nice), I've tested some simple file comparisons, but I need you guys' input. Am I doing this right or is there a piece of software that I haven't found yet?? Thanks for all input :-)
Why don't you use the aforementioned Powershell to run a scan/replace script and toss that into NETLOGON. Seems like that would be easier and more sensible, as it sounds like you're using organizational shares.
"There are three kinds of lies: lies, damned lies and statistics." - Benjamin Disraeli