Matthias
Tue Oct 05 12:42:52 CDT 2004
Dr John Stockton wrote:
>JRS: In article <OnaXaxiqEHA.896@TK2MSFTNGP12.phx.gbl>, dated Mon, 4
>Oct 2004 17:08:11, seen in news:microsoft.public.scripting.vbscript,
>Philip Colmer <pcolmer@newsgroups.nospam> posted :
>>Can someone suggest how I might be able to update the modification date of a
>>file to the current date & time without losing the content of the (binary)
>>file?
>
>In MSDOS, a file has a single date, shown by DIR; it is, barring tricks,
>the date of last modification; it is the date most commonly shown in
>Windows.
>
>In Windows, files have more dates - creation date, write date, and
>access date.
>
>Reading changes the access date, writing might do so. Neither should
>change the creation date.
>
>You have asked to change the modification date, but not asked to change
>the creation date; therefore, "solutions" presented should preserve the
>creation date, or give you due warning.
>
>A file might be on a floppy, or indeed a hard drive, and be larger than
>the free disc space; in that case, any method based on copying will fail
>(that might not *always* be the case, with modern Windows buffering).
>
>The task is to change a few bits, no more than 64, in a directory entry;
>even with modern Windows buffering, copying large files may be
>perceptibly time-wasting, especially if processing many files or working
>on a floppy.
>
>
>There is a DOS utility called TOUCH (in many versions) which does just
>what you want; I don't know what side-effects it may have on other
>Windows dates; there may be a true Windows version. My own version is
>DOSSTAMP, via sig line 3; it uses Borland Pascal SetFTime(F, LI) which I
>assume to be a mere wrapper for Int 21/57.01 - see Ralf Brown's List.
>
>There is, I suppose, a Windows API or suchlike to read/write all three
>(and any other) datestamps; if no true WINTOUCH exists, perhaps some MVP
>could write one?
>
There are a lot, IMO originating in multi user os.
Here is one allowing to set given dates for c/w/a :
L:\Winstall\_TOOLS\AINTX>touch
Error: Usage: touch changes file time
Syntax: touch [-a time | -c time | -w time] -f filename
Switches
-a: change last access time where time is YYYYMMDDhhmmss
-c: change creation time
-f: file to change
-w: change last write time
http://www.dwam.net/docs/aintx/
HTH
--
Greetings
Matthias