CiderPress2
CiderPress2 copied to clipboard
Set timestamps on exported files to match original
The timestamps on extracted files are set to match the original, but when files are exported (e.g. Applesoft BASIC to text), the dates aren't changed.
In some contexts it makes sense to use the current date/time on exported files. When converting SHR images to PNG, there's not much value in retaining the original date, and being able to find recently-created files by sorting the directory by mod time can be useful.
On the other hand, when files are both exported and imported, losing the original file date is undesirable. Source code, such as Applesoft and Merlin asm files, should retain the original date so that it's possible to identify the age of the file.
The current behavior retains the timestamp during import, but doesn't set the timestamp during export. Changing the export behavior to set the timestamp improves consistency with other commands: import/export would work the same way, and extract/export would work the same way. The behavior could be made optional, but it's unclear that having the file mod timestamp set to the current time is important enough to warrant adding an option and plumbing it through.
So it's a minor victory for the hobgoblins of consistency, and possibly a minor failing of the Principle of Least Surprise.
There is an argument to be made that the behavior should be different for reversible transformations and non-reversible transformations, e.g. a simple EOL conversion in a text file should retain the timestamp, but SHR -> PNG should not. However, that makes the rules inconsistent, and potentially required to change if we add a PNG -> SHR conversion.
If nothing else, touch *
is pretty easy for CLI users who require current timestamps.