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


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@cygwin.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/


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