Path: utzoo!utgpu!news-server.csri.toronto.edu!clyde.concordia.ca!thunder.mcrcim.mcgill.edu!poly-vlsi!siegfried!pierreg From: pierreg@siegfried.vlsi.polymtl.ca (Pierre Girard) Newsgroups: comp.unix.questions Subject: Re: changing file times Message-ID: Date: 21 Nov 90 15:09:30 GMT References: <28928@boulder.Colorado.EDU> Sender: news@vlsi.polymtl.ca (USENET News System) Organization: Ecole Polytechnique de Montreal, Canada Lines: 80 In-Reply-To: englund@tramp.Colorado.EDU's message of 30 Oct 90 07:45:17 GMT Here is a small C program that can help you do this. ---- CUT HERE --- /* This program can change the date and time of a file using the current time a a reference. Arguments : [-d days] [-h hour] [-m minutes] -[s seconds] [file1][file2]... Defaults values give the same results as touch Programmer : Pierre Girard November 1990 */ #include #include #define DAY (24*HOUR) #define HOUR (60*MIN) #define MIN (60*SEC) #define SEC (1) main(argc,argv) int argc; char **argv; { struct utimbuf times; time_t tloc; int i; int deltad=0, deltah=0, deltam=0, deltas=0; for(i=1;i