delorie.com/archives/browse.cgi | search |
X-Recipient: | archive-cygwin AT delorie DOT com |
X-SWARE-Spam-Status: | No, hits=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,T_RP_MATCHES_RCVD |
X-Spam-Check-By: | sourceware.org |
Message-ID: | <4BB4CAFE.5070605@redhat.com> |
Date: | Thu, 01 Apr 2010 10:34:06 -0600 |
From: | Eric Blake <eblake AT redhat DOT com> |
User-Agent: | Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.8) Gecko/20100301 Fedora/3.0.3-1.fc12 Lightning/1.0b1 Thunderbird/3.0.3 |
MIME-Version: | 1.0 |
To: | cygwin AT cygwin DOT com |
Subject: | Re: fopen with "a+" does not respect setting file read position to start of file |
References: | <B0E0B6C348D8AB4BAD6290DC0BDE99D47427D7442A AT GVW1115EXC DOT americas DOT hpqcorp DOT net> <4BB482FA DOT 3030201 AT ltu DOT se> <op DOT vahh3o181e62zd AT balu DOT cs DOT uni-paderborn DOT de> |
In-Reply-To: | <op.vahh3o181e62zd@balu.cs.uni-paderborn.de> |
X-IsSubscribed: | yes |
Mailing-List: | contact cygwin-help AT cygwin DOT com; run by ezmlm |
List-Id: | <cygwin.cygwin.com> |
List-Subscribe: | <mailto:cygwin-subscribe AT cygwin DOT com> |
List-Archive: | <http://sourceware.org/ml/cygwin/> |
List-Post: | <mailto:cygwin AT cygwin DOT com> |
List-Help: | <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs> |
Sender: | cygwin-owner AT cygwin DOT com |
Mail-Followup-To: | cygwin AT cygwin DOT com |
Delivered-To: | mailing list cygwin AT cygwin DOT com |
--------------enig944A91C66923355F862917B1 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: quoted-printable On 04/01/2010 05:53 AM, Matthias Andree wrote: >> Well if that worked previously it was a bug. >=20 > Not a Cygwin defect, but an application bug, and what Gavin named "work > around" is actually the right fix. >=20 > 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. --=20 Eric Blake eblake AT redhat DOT com +1-801-349-2682 Libvirt virtualization library http://libvirt.org --------------enig944A91C66923355F862917B1 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) Comment: Public key at home.comcast.net/~ericblake/eblake.gpg Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/ iEYEARECAAYFAku0ywEACgkQ84KuGfSFAYBP4ACfV1BGi7sPML01jLpul/N3OQSP 8ikAn0NarTjKWNVdDXQs5oqZ6ekOtIH/ =0YgL -----END PGP SIGNATURE----- --------------enig944A91C66923355F862917B1--
webmaster | delorie software privacy |
Copyright © 2019 by DJ Delorie | Updated Jul 2019 |