Xref: utzoo comp.sys.sgi:3284 comp.unix.wizards:20988 Path: utzoo!attcan!uunet!clyde.concordia.ca!jarvis.csri.toronto.edu!utgpu!watserv1!mims-iris.waterloo.edu!tom From: tom@mims-iris.waterloo.edu (Tom Haapanen) Newsgroups: comp.sys.sgi,comp.unix.wizards Subject: Setting the access/modify time on a file Message-ID: <1413@watserv1.waterloo.edu> Date: 12 Mar 90 15:30:23 GMT Sender: daemon@watserv1.waterloo.edu Reply-To: tom@mims-iris.waterloo.edu (Tom Haapanen) Organization: WATMIMS Research Group, University of Waterloo Lines: 29 I wish to update a file (with an advisory lock), and then to close it, setting the access and modify times to (almost) the same time. 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); Now, at what point does the modify time get set? the utime() call appears to set the access time, but the modify time appears to be set AGAIN after the access time. Where SHOULD it get set? And what should I do to make sure that my access time > modify time? The OS is IRIX 3.2 -- aka System V.3. Thanks for any and all replies! [ \tom haapanen -- university of waterloo -- tom@mims-iris.waterloo.edu ] [ "i say what i say, but i say it for myself and myself only" -- me ] [ "i don't even know what street canada is on" -- al capone ]