3.1.1
This release finally fixes the st_mtime
comparison bug with the commit 25eada3 🥳. Here is an explanation of the bug:
ddir
uses shutil.copy2
to copy files and directories. This function tries to copy the metadata like timestamps as well. When copying data to an external storage device with a different file system, there is an issue with the accuracy of those timestamps:
To determine if a file is newer or older, ddir
uses the st_mtime
property, which is the UNIX timestamp as float. This float happens to be of a different accuracy depending on the storage device and file system. On all my internal devices (SSD and NVMe, APFS and ext4), the float has an accuracy of 6 decimal places, but on my external devices (SSD, exFAT) it only has an accuracy of 2 decimal places. This causes all comparisons to be not equal and thus a file is marked as modified though it isn't. This is why I implemented a sneaky comparison, that cuts of the overlapping decimal places without rounding them.