Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site ulysses.UUCP Path: utzoo!linus!security!genrad!decvax!harpo!eagle!mhuxl!ihnp4!ulysses!smb From: smb@ulysses.UUCP Newsgroups: net.unix-wizards Subject: Re: Strange time() vs. stat() bug Message-ID: <730@ulysses.UUCP> Date: Wed, 7-Dec-83 16:32:35 EST Article-I.D.: ulysses.730 Posted: Wed Dec 7 16:32:35 1983 Date-Received: Fri, 9-Dec-83 04:30:13 EST References: <292@aecom.UUCP> Organization: AT&T Bell Laboratories, Murray Hill Lines: 10 To save memory space, in-core i-nodes don't have modification/acces/change times included. Instead, they have bit-flags that tell sync() to update the disk version of those fields. Since sync() is normally invoked every 30 seconds, the times are usually "accurate enough". Now -- stat() prefers to use the disk-resident copy of the i-node. This is proper for many reasons, not least of which is so that it can get at those timestamps. To ensure that the disk copy is current, stat calls sync() first -- which updates the disk copy, and uses the time value as of when sync() was called.