Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/5/84; site yetti.UUCP Path: utzoo!utcs!mnetor!yetti!tlim From: tlim@yetti.UUCP (Terry Lim) Newsgroups: net.sources.mac Subject: touch for Aztec C Message-ID: <250@yetti.UUCP> Date: Fri, 6-Sep-85 07:38:14 EDT Article-I.D.: yetti.250 Posted: Fri Sep 6 07:38:14 1985 Date-Received: Fri, 6-Sep-85 14:17:14 EDT Organization: York University Computer Science Lines: 75 /* touch.c by Terry Lim York University utzoo!yetti!tlim 26-Aug-1985 For use in the Aztec C environment. If you go into a source file using Edit and quit without making any changes, make will get confused and recompile the undisturbed file. Touch the .o file to prevent this. The program brings a file's "time of last modification" up to date by copying the current system time from RAM into the file header. Multiple files and wildcards are possible, per courtesy of the Aztec C shell. However, no current working directory is assumed so you have to specify entire path names. */ #include #include #include main(argc,argv) int argc; char *argv[]; { OSErr err; /*result of touch() call*/ int i; /*step through argv[]*/ if (argc<2) /*no arguments*/ fprintf(stderr,"touch what?\n"); else for (i=1; iioNamePtr=(StringPtr)ctop(name); parmptr->ioVRefNum=0; /*default volume*/ parmptr->u.iop.ioVersNum=0; /*must be zero*/ parmptr->u.fp.ioFDirIndex=0; /*don't use file number*/ if (result=PBGetFInfo(parmptr,FALSE)) return result; GetDateTime(&time); parmptr->u.fp.ioFlMdDat=time; /*reset time of last modification*/ if (result=PBSetFInfo(parmptr,FALSE)) return result; return 0; /*if we got here, all's well*/ }