Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 5 Jun 2001 11:00:16 -0700 (PDT)
From:      <phk@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
Message-ID:  <200106051800.f55I0Gh11644@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200106051800.f55I0Gh11644>