Eric Blake wrote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

According to Salvador Fandino on 11/13/2009 1:36 PM:
Hii

Using ftell() after fopen(..., "a") returns 0 even when the file open for 
appending is not empty. AFAIK, it should return the size of the file.

Not a bug.  POSIX allows this behavior, and Linux does it as well.  POSIX
also allows BSD behavior of seeking to the end, although this is less
friendly to reading back a file opened with fopen(...,"a+").  So portable
programs can't expect either situation, and you MUST use fseek when
opening for append if you expect a particular position.

however writing will always take place at the end of the file.
"Opening a file with append mode (a as the first character in the mode argument) shall cause all subsequent writes to the file to be forced to the then current end-of-file, regardless of intervening
calls to fseek( )."
rw
- --
Don't work too hard, make some time for fun as well!

Eric Blake             e...@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/

iEYEARECAAYFAkr9xGoACgkQ84KuGfSFAYC8CACgtx1ZxOtKVaGF2xk2UHg+1B7c
7cUAniO/T6EOm0gxRRx/1wsCM6P2HXXl
=xedo
-----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




--
Roger Wells, P.E.
SAIC
221 Third St
Newport, RI 02840
401-847-4210 (voice)
401-849-1585 (fax)
roger.k.we...@saic.com


--
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

Reply via email to