Page 1 of 1

Creation and Modification Timestamps

Posted: Thu Nov 15, 2018 8:19 am
by Semi-Happy Partygoer
This is incredibly nitpicky, I know, but I thought I'd ask out of curiosity.

For the record, as it may vary by operating system, I currently use Windows 7. When copying files, either from a CD or folder, the "date modified" timestamp remains the same as the original but the "date created" will reflect the time and date of the copy's creation. That's usually the case when extracting from a ZIP or RAR file, but sometimes, I think when I've tried different programs, the "created" remains the same while the "modified" retains the original time, or else both change to reflect the new time.

I'm not quite sure what programs do it which way, but my question is this: is there any way to extract and/or copy files to the hard drive in a manner that allows them to retain both their original modification and creation timestamps? I know it's minutia, but I would like to try and gain a more solid understanding about the nature of file duplication and retaining original metadata.

Re: Creation and Modification Timestamps

Posted: Thu Nov 15, 2018 8:48 am
by Collector
Don't know if Qbix will see this or not, but it sounds like this is the same problem that causes the dates to change when a file is copied within DOSBox. He may be able to give more insight.

Re: Creation and Modification Timestamps

Posted: Thu Nov 15, 2018 6:16 pm
by goatmeal
You might find the following program helpful; I know I have:

https://www.nirsoft.net/utils/bulk_file_changer.html
Description

BulkFileChanger is a small utility that allows you to create files list from multiple folders, and then make some action on them - Modify their created/modified/accessed time, change their file attribute (Read Only, Hidden, System), run an executable with these files as parameter, and copy/cut paste into Explorer.
I use it in conjunction with a batch file that copies "newer" files from my flash drives to my hard drive as a back-up. The problem comes in whenever I have to copy files BACK to the flash drive -- all of the files are copied from the HD with the current date, NOT the creation date. This program allows for easy date modification of bulk files.

(Using Windows 7, too.)

Re: Creation and Modification Timestamps

Posted: Fri Nov 16, 2018 12:35 pm
by Semi-Happy Partygoer
Thanks for the tip about the file changer. I'd forgotten that I'd actually installed a shell extension which does the same thing. So yes, I have the option to restore the original timestamps, which is great.

I would be curious to learn, though, how and why different programs handle them differently. The DOSBox installation/copying issue, for instance. If Qbix does see this, I'd very much like to hear his take on it.

Re: Creation and Modification Timestamps

Posted: Sat Nov 17, 2018 5:12 am
by Qbix
Well, applications themselves can set them, but if you don't set them, you end up with how DOSBox does it.
Games inside DOSBox indeed try to set the date and time on certain files. Currently this is ignored by DOSBox.
I couldn't come up with code that works correctly for setting the date/time on all hosts and under all conditions (like changing daylight time). There are some people who submitted patches, but they aren't handling all the cases that I ideally would like to be able to handle.