On Fri, 11 Oct 2013 04:30:39 -0700 (PDT), Anil Nair wrote:
> Here is the original dir,
>
> "
> C:\>dir d:\
> Volume in drive D is PDOS
> Volume Serial Number is 3440-17FA
>
> Directory of D:\
>
> IO SYS 11,252 10-11-13 4:29p
> MSDOS SYS 37,562 10-11-13 4:46p
> COMMAND COM 37,918 10-11-13 1:01p
> FROM <DIR> 10-11-13 4:30p
> XCOPY EXE 15,538 09-22-07 10:10a
> 1 C 32,259 00-00-80 12:00a
> 5 file(s) 134,529 bytes
> 1 dir(s) 30,625,792 bytes free
> C:\>
> "
>
> I use xcopy and then replace the file,
> "
> C:\>xcopy 1.c d:\
> Overwrite D:\1.C (Yes/No/Overwrite all/Skip all)? y
> Copying C:\1.C
> 1 file(s) copied
> C:\>dir d:
> Volume in drive D is PDOS
> Volume Serial Number is 3440-17FA
>
> Directory of D:\
>
> IO SYS 11,252 10-11-13 4:29p
> MSDOS SYS 37,562 10-11-13 4:46p
> COMMAND COM 37,918 10-11-13 1:01p
> FROM <DIR> 10-11-13 4:30p
> XCOPY EXE 15,538 09-22-07 10:10a
> 1 C 32,259 00-00-80 12:00a
> 5 file(s) 134,529 bytes
> 1 dir(s) 30,625,792 bytes free
> "
That's because the source "1.C" file date (which isn't shown) is also
"00-00-80 12:00a", or any other invalid date value. The
COMMAND.COM will
show invalid dates like those above.
> Now how does freedos preserve the file time and date of the file "1.c"
Using DOS interrupt with raw timestamp value, which is in FAT timestamp
format.
You won't be able to do this if you're using getftime and setftime.