VOGONS


First post, by David00

User metadata
Rank Newbie
Rank
Newbie

Hello,

I noticed that this function isn't supported in DOSBox. There were some old posts from 2006 about this, but the links don’t work anymore.
Looking at the source for DOS_GetFileDate (Fn 5700h), I can see it pulling the date and time from the file’s directory entry date and time fields:
*otime = Files[handle]->time;
*odate = Files[handle]->date;

I thought it would be easy to implement a DOS_SetFileDate by simply reversing these and then writing out the directory entry. That is what I believe happens in real DOS, with the HCB date and time updated, as well as being marked as modified so that the directory entry is written to disk as part of a subsequent File Close (3Eh).

I’m not a C/C++ programmer, and would struggle to implement this. Can it be considered for implementation in the next release please?

Reply 2 of 4, by David00

User metadata
Rank Newbie
Rank
Newbie

It's not a game - yet. I've been trying to resurrect some old build tools which rely on Int 21h AX=5701 Set file date/time. A simple example is Borland's touch.com utility, which updates the date/time stamp of a file to the current time.

It doesn't look like a particularly onerous fix, just a few lines of code...

Reply 3 of 4, by ripsaw8080

User metadata
Rank DOSBox Author
Rank
DOSBox Author
David00 wrote:

It doesn't look like a particularly onerous fix

Probably because you haven't considered all supported platforms. 😉

Patches (for Windows) have been made, and the feature discussed at length:
File Timestamp (DOSBOX Windows XP+)
Date & Time Mismatch?