[Issue 14422] New: std.process: Pipes do not append to files on Win64
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Tue Apr 7 04:50:37 PDT 2015
https://issues.dlang.org/show_bug.cgi?id=14422
Issue ID: 14422
Summary: std.process: Pipes do not append to files on Win64
Product: D
Version: D2
Hardware: x86_64
OS: Windows
Status: NEW
Severity: normal
Priority: P1
Component: Phobos
Assignee: nobody at puremagic.com
Reporter: thecybershadow at gmail.com
//////////////////////////// test.d ///////////////////////////
import std.process;
import std.stdio;
import std.file;
void main()
{
auto fn = "fn.txt";
std.file.write(fn, "AAAAAAAAAA");
auto f = File(fn, "a");
spawnProcess(["cmd", "/c", "echo BBBBB"], stdin, f).wait();
auto data = readText(fn);
assert(data == "AAAAAAAAAABBBBB\r\n", data);
}
///////////////////////////////////////////////////////////////
This program runs fine on Win32, but the assert fails on Win64.
For some reason, the "a" mode is being ignored, and the content is written to
the beginning of the file, clobbering the original file header.
--
More information about the Digitalmars-d-bugs
mailing list