https://issues.dlang.org/show_bug.cgi?id=14505

Steven Schveighoffer <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[email protected]

--- Comment #5 from Steven Schveighoffer <[email protected]> ---
I don't think there's any requirement in C for this to be the case.

What your test case has exposed is implementation differences for different C
libraries.

Note that I can write a C program that compiles with both MSVCRT and DMC
library, and have the same issue. D does not do anything to the file pointer in
the "a+" case. We only do it in the "a" case, since that case will not cause
issues for any other usage (you can only write to an "a" file, and it should
always write to the end of the file), but fixes an issue with std.process.

I'm tempted to close as INVALID.

(In reply to Vladimir Panteleev from comment #4)
> Is ftell supposed to return specifically the read pointer's position (and
> not the write pointer's)?

It tells the current position of the file descriptor. There is no different
"read" or "write" pointer. When writing, the C library (or the OS in the case
of Unixen) seeks the stream to the end.

--

Reply via email to