Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watmath!clyde!rutgers!husc6!bbn!rochester!rocksanne!rocksvax!martyl From: martyl@rocksvax.UUCP Newsgroups: comp.sys.ibm.pc Subject: Re: lattice-c source of touch.c for ibm-pc dos Message-ID: <95@rocksvax.UUCP> Date: Fri, 2-Oct-87 17:50:00 EDT Article-I.D.: rocksvax.95 Posted: Fri Oct 2 17:50:00 1987 Date-Received: Sun, 4-Oct-87 07:12:37 EDT References: <3888@ihlpg.ATT.COM> Reply-To: martyl@rocksvax.UUCP (Marty Leisner) Organization: Xerox: Henrietta, NY Lines: 37 Keywords: touch lattice source Wow -- I was impressed at how code can expand to fill available space. When I found I needed to have a copy of touch on a ms-dos system when I first needed one, I whipped this up in a few minutes (it has no c or f options) -- /* File: touch.c - created by Marty Leisner */ /* leisner.Henr 14-Mar-87 15:11:35 */ /* Copyright (C) 1987 by Martin Leisner. All rights reserved. */ /* something like unix touch */ #include main(argc, argv) int argc; char *argv[]; { while(--argc) { argv++; if(utime(*argv, NULL)) printf("can't update file %s\n", *argv); } } I first used open and close on the files (which I believe forces a dos timestamp, but then I found out Aztec supports the utime function. It did the job. -- marty leisner xerox corp leisner.henr@xerox.com martyl@rocksvax.uucp