GZIPDATE.REX (uses TOUCH) (Developers)
> FYI, PC Magazine also created 2 touch utils which were available as
> follows:
> touch.com (v7n07.zip) - assembler version with soruce by Michael J.
> Mefford
> touchw.exe (v8n02.zip) - C version by ?? (C ver doesn't like readonly
> files!)
>
> But sadly I am not going to link to either. The reason why if
> my memory serves me correctly is comes down the publisher of PC Mag (Ziff
> Davis) deciding in the mid 90's to contact simtel (and mirrors) and
> legally ask them to remove all the PC Mag utils which at the time were
> widely available.
Yes, I'm aware of that, and yes it's a little silly, considering it limits the usefulness, but oh well, we can't have everything, can we? :-/
> > if not creating a new file (which -C forbids), why open for read/write
> > (3D02)??
>
> No doubt for safety, since read-only is effectively saying "don't touch me".
Except I never thought of readonly in that way. +R usually means (to me) "don't modify the file data" whereas touch only changes the file's time (in the file system itself). It's very rare that someone would accidentally touch a readonly file, but to fair that's why it should probably be optional (e.g. DR-DOS /R or 4DOS /F or FD-TOUCH /C here).
> > debug touch2.com < %0
>
> I seem to remember this may fail on some (newer?) DOS shells and you need
> to do %0.bat on those otherwise the file is NOT found.
>
> if exist .\%0 call debug <%0> if exist .\%0.bat call debug <%0.bat
Yes, that's why I did this at the top (see below). 
if not exist %0 %0.bat
BTW, GNU touch (Coreutils, formerly Fileutils, e.g. DJGPP's FIL41B.ZIP) seems to not have the +r bug. However, in my limited experience, it's weird in what it accepts. FreeDOS touch is more forgiving. Heck, even DR-DOS touch whines if you don't specify the year correctly despite the help usage (needs four-digit year or maybe two, I forget). Charles Dye's version is good, but it has no LFN support nor +r override (though it lets you change attributes ... but I dislike removing +r for no good reason).
FreeDOS touch is written in TASM (boo hiss ... but I did a temporary quick hack to NASM which I will have to polish up if anyone cares), but at least it supports various non-US date formats, assemble-time NLS, switchars (anybody use that?), no file lists, no LFNs, DOS 2.0 compatible (QUALPATH.ASM seems to mimic int 21h,60h [DOS 3+]), but only changes modification time (not FAT32 access or creation time). In other words, the best touch util is probably the one in 4DOS, but not everybody uses 4DOS, and it's quite a big util to use just for touching files. 
P.S. Slightly annoying that you have to use a file handle to touch a file instead of a pointer to ASCIIZ, but I guess "open + touch" isn't so much to ask.
EDIT: See int 21h, 57xxh or 7143h
EDIT #2: For the record, I'm pretty sure FreeDOS doesn't update FAT32 time/date-stamps besides creation.
Complete thread:
- TOUCH.COM 1.4.3 (minor fix: debug script) - Rugxulo, 02.03.2010, 01:10 (Developers)
![Open in board view [Board]](img/board_d.gif)
![Open in mix view [Mix]](img/mix_d.gif)
- GZIPDATE.REX (uses TOUCH) - Rugxulo, 02.03.2010, 01:22
- GZIPDATE.REX (uses TOUCH) - Arjay, 11.03.2010, 17:09
- GZIPDATE.REX (uses TOUCH) - Rugxulo, 11.03.2010, 19:41
- GZIPDATE.REX (uses TOUCH) - Arjay, 18.03.2010, 16:31
- GZIPDATE.REX (uses TOUCH) - Rugxulo, 19.03.2010, 00:58
- GZIPDATE.REX (uses TOUCH) - Arjay, 22.03.2010, 00:40
- GZIPDATE.REX (uses TOUCH) - Rugxulo, 22.03.2010, 17:47
- GZIPDATE.REX (uses TOUCH) / Tim Paterson / DOS v3 required - Arjay, 23.03.2010, 16:25
- GZIPDATE.REX (uses TOUCH) / Tim Paterson / DOS v3 required - Rugxulo, 23.03.2010, 16:59
- [deleted] - Arjay, 23.03.2010, 19:32
- TOUCH 1.4.4 - Rugxulo, 07.04.2010, 00:05
- [deleted] - Arjay, 23.03.2010, 19:32
- GZIPDATE.REX (uses TOUCH) / Tim Paterson / DOS v3 required - Rugxulo, 23.03.2010, 16:59
- GZIPDATE.REX (uses TOUCH) / Tim Paterson / DOS v3 required - Arjay, 23.03.2010, 16:25
- GZIPDATE.REX (uses TOUCH) - Rugxulo, 22.03.2010, 17:47
- GZIPDATE.REX (uses TOUCH) - Arjay, 22.03.2010, 00:40
- GZIPDATE.REX (uses TOUCH) - Rugxulo, 19.03.2010, 00:58
- GZIPDATE.REX (uses TOUCH) - Arjay, 18.03.2010, 16:31
- GZIPDATE.REX (uses TOUCH) - Rugxulo, 11.03.2010, 19:41
- GZIPDATE.REX (uses TOUCH) - Rugxulo, 07.04.2010, 01:06
- GZIPDATE.REX (uses TOUCH) - Arjay, 11.03.2010, 17:09
- GZIPDATE.REX (uses TOUCH) - Rugxulo, 02.03.2010, 01:22
Mix view