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: fopen with "a+" does not respect setting file read position to start of file


On 04/01/2010 05:53 AM, Matthias Andree wrote:
>> Well if that worked previously it was a bug.
> 
> Not a Cygwin defect, but an application bug, and what Gavin named "work
> around" is actually the right fix.
> 
> POSIX explicitly states that the initial position beginning/end of file
> in append mode is implementation-defined, and the Cygwin documentation
> doesn't make promises either way. Linux and FreeBSD document BOF and
> EOF, respectively.

I agree that it is not a cygwin bug.  And I actually prefer Linux'
interpretation of BOF, since it matches with the POSIX requirement that
open(,O_APPEND|O_RDWR) be positioned at offset 0 and not at the end (it
is only fopen that is allowed, but not required, to be at the end).  In
fact, the release of m4 1.4.10 worked on cygwin and Linux but was broken
on BSD because of this very portability pitfall.

-- 
Eric Blake   eblake@redhat.com    +1-801-349-2682
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]