I am having trouble with the FPlatformProcess::WritePipe() function.
I have:
Created a pipe FPlatformProcess::CreatePipe(readPipe, writePipe)
Created my process PlatformProcess::CreateProc(*url, *params, false, false, false, processID, 0, nullptr, writePipe) - Works
I can read from my pipe and get feedback from the exe program: FPlatformProcess::ReadPipe(readPipe) - Works
Every time I write with the WritePipe() function it returns true, but It does not reflect on the exe.
FString* out = new FString();
if (!FPlatformProcess::WritePipe(writePipe, command, out))
{
return false;
}
Has anyone tried using this method before?
Note this exe works with C# StreamWriter.WriteLine(string)
You’re probably well past this by now but I was having the same issue (so this is for others facing this issue). I decided to read the Microsoft docs, since the underlying code is just calling the Windows API (on windows).
I was able to get this working by following the standard Windows API:
that’s because when you create the pipe, you only create the pipe that transmit data from outer process to UE, but didn’t create a pipe that transmit data from ue to outer process.So you may want to do as Brent do, which is creating another pipe, and give the readHandle to the process when creating it.