From fbd8de0397f84ba65a31a7d599a5b333dfcf3cbe Mon Sep 17 00:00:00 2001 From: maron2000 <68574602+maron2000@users.noreply.github.com> Date: Sun, 4 Aug 2024 20:32:09 +0900 Subject: [PATCH] LABEL command to add timestamp --- src/dos/drive_fat.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/dos/drive_fat.cpp b/src/dos/drive_fat.cpp index e383c28062..2f51e1999e 100644 --- a/src/dos/drive_fat.cpp +++ b/src/dos/drive_fat.cpp @@ -874,7 +874,13 @@ void fatDrive::SetLabel(const char *label, bool /*iscdrom*/, bool /*updatable*/) while (j < 11 && *s != 0) sectbuf[entryoffset].entryname[j++] = *s++; while (j < 11) sectbuf[entryoffset].entryname[j++] = ' '; } - writeSector(tmpsector,sectbuf); + uint16_t ct, cd; + time_t_to_DOS_DateTime(/*&*/ct,/*&*/cd, ::time(NULL)); + sectbuf[entryoffset].modTime = ct; + sectbuf[entryoffset].modDate = cd; + sectbuf[entryoffset].accessDate = cd; + + writeSector(tmpsector,sectbuf); labelCache.SetLabel(label, false, true); UpdateBootVolumeLabel(label); return;