| Thread Closed |
Fastest way to file diff |
Share Thread | Thread Tools |
| Apr8-08, 10:10 AM | #1 |
|
|
Fastest way to file diff
I am making a Makefile generator and for that, I need something like:
There is a list of files. When the generator is run, I need to know that which files out of those have changed since the last time the generator was run so as to not to include these files in the compiling list. I was thinking first a filesize check and if they match, a checksum. Would that do? Since the program i'll be making would be Windows-native, so I can use anything from the Win32 API, something that would allow me to check the last file modified date?? Since the list of files could be HUGE.. i need to know the fastest way to do this. Any help is appreciated. thanks, rohan |
| PhysOrg.com |
science news on PhysOrg.com >> Hong Kong launches first electric taxis >> Morocco to harness the wind in energy hunt >> Galaxy's Ring of Fire |
| Apr8-08, 07:54 PM | #2 |
|
|
1- the generator reads the last time it was run (from a "special file")
2- for each file in the list, the generator checks the last modified date 3- at the end of the whole process, the generator should "touch" the "special file" in order to store the new timestamp |
| Apr8-08, 11:12 PM | #3 |
|
|
but what i needed to know was how to get the last modified date for a file? Also, if I don't use date but purely filesize and checksum, will it be fine? [I mean collision wise as well as speed wise] |
| Apr9-08, 02:32 AM | #4 |
|
|
Fastest way to file diff
In the win32 API I think the function you are looking for is GetFileTime()
You can go on checksum alone if you want to, but it means more work. Also, there is no need to check the filesize if you have a checksum. The easiest approach is checking the timestamps though. And there is no need to save the time stamps in an index-file, just compare the "modified" time of the source files against the "created" time of the binary. k |
| Apr9-08, 03:07 AM | #5 |
|
|
also, using a filesize check with checksums can reduce the checksum collision rate a bit... EDIT: Got it here: http://msdn2.microsoft.com/en-us/lib...20(VS.85).aspx but there is a problem associated with it: |
| Apr9-08, 05:00 AM | #6 |
|
|
k |
| Thread Closed |
| Thread Tools | |
Similar Threads for: Fastest way to file diff
|
||||
| Thread | Forum | Replies | ||
| What's the fastest way to increase file size? | Programming & Comp Sci | 11 | ||
| Fastest possible speed car? | Mechanical Engineering | 8 | ||
| Make a Pdf file into an ordinary web file (html file)? | Computing & Technology | 3 | ||
| Which travels fastest? | Brain Teasers | 4 | ||
| My network directory file synch batch file thing :) | Computing & Technology | 2 | ||