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: Redirecting output from running proc doesn't modify the "last modified time" field for target file


On 12/02/2011 11:50 AM, Jon Clugston wrote:
> While this loop is running, the timestamp on "x.log" doesn't change
> (whereas on Linux it changes every 10 seconds).  It sure looks to me
> that Windows just doesn't bother updating the file timestamp while it
> is open.  I don't know if this update is required by POSIX - I would
> doubt that it is.

POSIX requires that any write() to an open file mark it for update; the
update doesn't have to occur right away (so you can batch up several
writes, but only change the mtime metadata once at the end of the
batch), but it DOES require that stat() and several similar functions
flush all marked updates prior to exposing timestamps to the user.  So
yes, Windows is violating POSIX, and I have no idea whether cygwin can
work around it.

-- 
Eric Blake   eblake@redhat.com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


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