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: [BUG] fopen(..., "a") does not seek to end of file until some write operation


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

According to Salvador Fandino on 11/13/2009 1:55 PM:
>> Not a bug.  POSIX allows this behavior, and Linux does it as well.
> 
> In Linux (at least on the one I have installed, Ubuntu 9.10) ftell does not return cero but the EOF offset:

Ok, so "a" and "a+" apparently behave differently in Linux.  Submit a
patch to newlib if it bothers you.  Still, the point remains that this
does not violate POSIX.  Also, since the underlying open() is _required_
to be at offset 0 when opening a file for appending, it is actually _more_
syscalls if stdio seeks to the end of an append stream during fopen(),
rather than waiting until the first write.

- --
Don't work too hard, make some time for fun as well!

Eric Blake             ebb9@byu.net
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkr9yz8ACgkQ84KuGfSFAYB5xQCfSJfFcEpkpFdiCQJ1WU1xFWHb
UigAn05HDxKfozs7eFkMgxZ8PiBgJoHS
=sfVV
-----END PGP SIGNATURE-----

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


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