This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: more ctime bugs


> -----Original Message-----
> From: cygwin-owner On Behalf Of Corinna Vinschen
> Sent: 11 February 2005 09:35

> On Feb  9 21:27, ericblake wrote:
> > Corinna, since you've been fixing so many ctime bugs lately 
> to match SUSv3
> > and POSIX, could you also fix open(2) when O_TRUNC is set, 
> and write(2) and
> > link(2) in general, to touch ctime?
> 
> 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?


  Explicitly permitted, the way I read SuS:

http://www.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap04.html#tag_04_07

------------------------<snip!>------------------------
Each function or utility in IEEE Std 1003.1-2001 that reads or writes data or
changes file status indicates which of the appropriate time-related fields shall
be "marked for update". 

[ ... ]

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. 
------------------------<snip!>------------------------

  So you clearly MUST update it when the file closes, and it's really up to you
whether you want to say that the periodic updates are done once every say....
hundred million years or so.... nobody'll notice if you just don't implement
them at that interval!


    cheers, 
      DaveK
-- 
Can't think of a witty .sigline today....


--
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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]