Back to home page

DOS ain't dead

Forum index page

Log in | Register

Back to the forum
Board view  Mix view

GZIPDATE.REX (uses TOUCH) (Developers)

posted by Rugxulo Homepage, Usono, 11.03.2010, 19:41
(edited by Rugxulo on 11.03.2010, 19:54)

> 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:

Back to the forum
Board view  Mix view
22758 Postings in 2121 Threads, 402 registered users (1 online)
DOS ain't dead | Admin contact
RSS Feed
powered by my little forum