X-Recipient: archive-cygwin AT delorie DOT com X-SWARE-Spam-Status: No, hits=-2.6 required=5.0 tests=BAYES_00 X-Spam-Check-By: sourceware.org Message-ID: <158595.94935.qm@web52607.mail.re2.yahoo.com> References: <592384 DOT 26227 DOT qm AT web52612 DOT mail DOT re2 DOT yahoo DOT com> <4AFDC46A DOT 3070503 AT byu DOT net> Date: Fri, 13 Nov 2009 12:55:46 -0800 (PST) From: Salvador Fandino Subject: Re: [BUG] fopen(..., "a") does not seek to end of file until some write operation To: Eric Blake , cygwin AT cygwin DOT com In-Reply-To: <4AFDC46A.3070503@byu.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com ----- Original Message ---- > From: Eric Blake > To: cygwin AT cygwin DOT com; sfandino AT yahoo DOT com > Sent: Fri, November 13, 2009 9:41:14 PM > Subject: 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: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. In Linux (at least on the one I have installed, Ubuntu 9.10) ftell does not return cero but the EOF offset: salva AT leon:/tmp$ ./a.out pos: 0 pos: 12 salva AT leon:/tmp$ ./a.out pos: 12 pos: 24 salva AT leon:/tmp$ ./a.out pos: 24 pos: 36 Cheers, - Salva -- 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