From owner-freebsd-bugs Tue Jun 5 11: 0:20 2001 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id EFA4137B405; Tue, 5 Jun 2001 11:00:16 -0700 (PDT) (envelope-from phk@FreeBSD.org) Received: (from phk@localhost) by freefall.freebsd.org (8.11.3/8.11.3) id f55I0Gh11644; Tue, 5 Jun 2001 11:00:16 -0700 (PDT) (envelope-from phk) Date: Tue, 5 Jun 2001 11:00:16 -0700 (PDT) From: Message-Id: <200106051800.f55I0Gh11644@freefall.freebsd.org> To: Arjan.deVet@adv.iae.nl, phk@FreeBSD.org, freebsd-bugs@FreeBSD.org Subject: Re: bin/8518: freopen() in append mode followed by ftell() gives strange results Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org Synopsis: freopen() in append mode followed by ftell() gives strange results State-Changed-From-To: open->closed State-Changed-By: phk State-Changed-When: Tue Jun 5 10:57:12 PDT 2001 State-Changed-Why: You can never trust *seek() to tell you where the next write will happen on a file opened in append mode, because another process might sneak in between your *seek() and write() calls. One could possibly use *seek() to discover the offset after the write completes and set the offset, it would then be possible to retroactively compute the location of the data in the file by calling write() first and then *seek(), subtracting the number of bytes written. http://www.FreeBSD.org/cgi/query-pr.cgi?pr=8518 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message