Wilson WindowWare Tech Support

WinBatch WinBatch+Compiler WebBatch
Home | Tech Database | Tech BBS | White Papers | Purchase


FileTimeSet: One Off Error?

Keywords: filetimeset fat tables 

Question:

Is there a bug that FileTimeSet rounds odd values down one second? Under Win 95 it seems that any attempt to set a file time to a value that has an odd number of seconds returns TRUE but the time stamp is actually set to one second earlier. Even values are respected. I'm running 96M. On my system, the following produces a result of 97:03:05:14:01:36.
FileTimeSet("somefile.tst","97:03:05:14:01:37")
Message("One Off?",FileYmdHms("somefile.tst"))

Answer:

No bug. In FAT filesystems the time resolution is two seconds. WinBatch affects and checks the MODIFIED file time - which has a resolution of 2 seconds. The CREATED file time can be an odd-numbered timestamp. The MODIFIED file time can only be even. I'm not quite sure how that works.

Thread continued:

Thanks for the info. I can easily accommodate the even timestamp now that I know about it.
Article ID:   W13865
Filename:   FileTimeSet Function.txt