2019-02-12 15:26:39 |
Łukasz Zemczak |
description |
The bin/checksum-directory script is intended to create checksums of all images in a given directory. The script itself offers a functionality of adding additional 'old directories' where it should look for existing checksums for images in the new directory and try re-using those - instead of re-checksumming the files all over again (to save time). This doesn't seem to work.
The checksum-directory merging of checksums works in such a way that each entry in the current directory is checked to see if it can be re-used from one of the olddirs. First there's a check for symlinks. If the entry is not a symlink, then the next method of 'checking' is checking the timestamps of the files. The current design of the timestamp checking makes it basically impossible to re-use checksums from other directories though.
Each file is checked for max(st.st_mtime, st.st_ctime) and then compared (entry_time > dir_time). Every move, hard-link or copy operation of an image file modifies at least one of the timestamps, resulting in checksum-directory not considering re-using the checksum. |
The bin/checksum-directory script is intended to create checksums of all images in a given directory. The script itself offers a functionality of adding additional 'old directories' where it should look for existing checksums for images in the new directory and try re-using those - instead of re-checksumming the files all over again (to save time). This doesn't seem to work.
The checksum-directory merging of checksums works in such a way that each entry in the current directory is checked to see if it can be re-used from one of the olddirs. First there's a check for symlinks. If the entry is not a symlink, then the next method of 'checking' is checking the timestamps of the files against the checksum-storage files. The current design of the timestamp checking makes it basically impossible to re-use checksums from other directories though.
Each image file is checked for max(st.st_mtime, st.st_ctime) and then compared with the old directory's checksums file (for instance, MD5SUMS) mtime (entry_time > dir_time). Every move, hard-link or copy operation of an image file modifies at least one of the timestamps (usually st_ctime), resulting in checksum-directory not considering re-using the checksum. I think only mtime should be checked? |
|