Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Date: Fri, 11 Feb 2005 15:25:42 +0100 From: Corinna Vinschen To: cygwin AT cygwin DOT com Subject: Re: more ctime bugs Message-ID: <20050211142542.GE2597@cygbert.vinschen.de> Reply-To: cygwin AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com References: <020920052127 DOT 27398 DOT 420A803A0009BD7500006B0622007507440A050E040D0C079D0A AT comcast DOT net> <20050211093508 DOT GB27256 AT cygbert DOT vinschen DOT de> <420CBCE6 DOT 60603 AT byu DOT net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <420CBCE6.60603@byu.net> User-Agent: Mutt/1.4.2i On Feb 11 07:10, Eric Blake wrote: > According to Corinna Vinschen on 2/11/2005 2:35 AM: > > No problem with open and link, but I'm a bit reluctant to do this in > > write. Setting the file time on each WriteFile looks like a pretty > > time consuming operation, so I'm a bit in doubt if every write operation > > should be slowed down by this, POSIX compatibility or not. Wouldn't > > it help in most cases, if the close after write sets the ctime? > > That idea is close to what I had in mind. Note that POSIX wording in 4.7 > for updating file times, > http://www.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap04.html: > > "An implementation may update fields that are marked for update > immediately, or it may update such fields periodically. At an update point > in time, any marked fields shall be set to the current time and the update > marks shall be cleared. All fields that are marked for update shall be > updated when the file ceases to be open by any process, or when a stat(), > fstat(), or lstat() is performed on the file. Other times at which updates > are done are unspecified. Marks for update, and updates themselves, are > not done for files on read-only file systems; see Read-Only File System." > > There is no minimum time specified for the periodic updates, [...] Thanks to you and Dave, especially for quoting the above Open Group chapter. I'll update Cygwin to set ctime in close and link. Link is special since it doesn't involve using any explicit file descriptors, so it's a bit unclear where to set the flags inside Cygwin to get that right. Using close() seems a good way to have ctime set for write() as well as open(O_TRUNC). Corinna -- Corinna Vinschen Please, send mails regarding Cygwin to Cygwin Project Co-Leader mailto:cygwin AT cygwin DOT com Red Hat, Inc. -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/