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?
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...
Which lets you know that this is an archinve of version 3.23
As this is all DOS based stuff, I use DosBox to maintain much of it these days, and I can't do this within DosBox as my TOUCH command appears to work but doesn't because DosBox doesn't support INT 21h AX=5701h
I may fix this at some point (I've made other fixes to DosBox), but so far I've not... My "simpler" solution was to add an ability to my ZDIR command (List content of .ZIP in directory listing format) which lets you set the timestamp of files within a .ZIP:
1ZipDIRectory 2use: ZDIR zipfile[.ZIP] [pattern][=[yr-mo-dy]-[hr:mi:se]]... [options] 3... 4If =yr-mo-dy-hr:mi:se those values in pattern-file timestamps will be changed 5(TOUCHed) * =skip but don't change. If first seperator is ':', only time 6is changed (not date). Some OSs (Windows) don't accept = (use "pattern=...")
Still annoying as it means modifying various programs, .BAT files etc. that I use to create these distributions (at least the ZDIR method still works in native DOS)
---
But what I consider a more serious problem is that when you COPY a file the timestamp on the COPY is the CURRENT time, NOT the timestamp of the original file. As I've written many tools over the years to maintain backups and auto-update files between various systems based on those file timestamps, this inability really confuses these tools. So, I have to perform such operations on the host OS (in my case Winblows) - which ment rewriting most of said tools for 32-bit OS, and just abandoning some operations because I really don't want to get that deep into it.
-- And I don't "buy" the arguement that "some host OSs might not support it".
What modern OS doesn't support some form of "touch" to a set timestamp?
and .. if you have an OS that doesn't, then DOS (remember this is DosBox) INT 21/5701 can be unsupported in that particular implementation of DosBox.
The whole idea that "DosBox won't support a fundamental function of DOS because it might not be supported in some of the host OSs" just seems "wrong" to me.
There are *many* DOS functions which have to be done differently from one host OS to another. That's the whole idea of "porting".
I do this sometimes ... but it really disables one of the prime capabilities of DosBox over other virtual machine systems... The ability to directly access files on the host (via "mount"ed drives)
Modifying file timestamps in booted DOS works - but you have the problem of getting files to/from that booted DOS system, as the it doesn't see the host filesystem, and the host doesn't see its filesystem.
It *is* possible to setup a network between booted DOS and the host, but simple DOS network clients are old/insecure and getting them to work involves reducing the network security of you "modern" systems (assuming of course you know what needs to be changed and how). And getting networking working beteen DOS and non-MS OSs is not all that simple, and no guarantee that it will support full DOS filesystem compatibility...
What I usually do is ZIP files and transfer the .zip ... fortunately I have FDI.COM which lets be add/retrieve files from Floppy Disk Images (which can be made imgmounted to the booted DOS), For .zips >1.4m, I use DDLINK to transfer them to/from either over a packet network connection, or a nullmodem serial link.
In the end I just modified ZDIR to change timestamps in .zips directly.
(and yeah - I see that this thread is old.. I just don't think I saw it before)
In either case you have to extract the files from the .zip on the host... unzipping within DosBox will replace the timestamps with CURRENT time!
(yeah - I know this thread is old - I just don't think I've seem it before)