Path: utzoo!attcan!uunet!ogicse!decwrl!ucbvax!hplabs!hpda!hpcupt1!hpisod2!decot From: decot@hpisod2.HP.COM (Dave Decot) Newsgroups: comp.unix.wizards Subject: Re: Setting the access/modify time on a file Message-ID: <14020087@hpisod2.HP.COM> Date: 13 Mar 90 05:16:05 GMT References: <1413@watserv1.waterloo.edu> Organization: Hewlett Packard, Cupertino Lines: 28 > Here is what I'm attempting: > > FILE *fp; > >>> long times; > > fp = fopen("filename", "w"); > flock(fileno(fp), LOCK_EX); > > ... much i/o to the file ... > > fflush(fp); > >>> times[1] = time(×[0]) - (long)2; > >>> utime(mailfile, times); > > flock(fileno(fp), LOCK_UN); > fclose(fp); The lines I marked with >>> above are parts of the problem: You did not declare "times" to be an array or initialize it as a pointer, but later use it as an array or initialized pointer. The argument and return value of time() are supposed to be a pointers to type time_t, which is not necessarily a long. You did not use lint before bothering 30,000 people. Dave Decot