Skip to content

Write to pipe #86

@Pecka95

Description

@Pecka95

Hey! Thank you for your plugin!
I have a question about writing to pipe and getting output from programm.
I read the data from the "readPipe" without any problems. But when I try to send data something through "writePipe", I get the same in the response in "readPipe" instead of the real output from the programm.

image

I created a new function "WriteToPipe" using the example of other code

bool UExecutableProcessPipe::CreatePipe()
{
	if(PipeIsValid())
	{
		//Ignore repeat creates without a close inbetween <3 Rama
		return true;
	}
	return FPlatformProcess::CreatePipe( ReadPipe, WritePipe);
}
void UExecutableProcessPipe::ClosePipe()
{
	if(PipeIsValid())
	{
		FPlatformProcess::ClosePipe(ReadPipe, WritePipe);
		ReadPipe = nullptr;
		WritePipe = nullptr;
	}
}
bool UExecutableProcessPipe::ReadFromPipe(FString& PipeContents)
{
	PipeContents = "";
	
	if(!PipeIsValid()) 
	{
		return false;
	}
	PipeContents = FPlatformProcess::ReadPipe(ReadPipe);
	
	return true;
}

bool UExecutableProcessPipe::WriteToPipe(FString InputString)
{
	if(PipeIsValid())
	{
		return FPlatformProcess::WritePipe(WritePipe, InputString);
	}
	return false;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions