[Gambas-user] Closing Process input stream

Benoît Minisini gambas at ...1...
Mon Jun 13 09:29:25 CEST 2016


Le 11/06/2016 17:27, Tobias Boege a écrit :
> Hi,
>
> I just tried to feed a Python script to Gimp from within a Gambas project.
> It didn't really work out that easily because Gimp wants to read the script
> from standard input (AFAIK it does not recognise a path to the script file).
> So I have to File.Load the script and Print it to the Gimp process. To
> signal that the script is complete, I have to close the Gimp process input
> stream. The only way I can do this is via
>
>    Close #hGimp
 >
 > but this line also closes the output stream so that I can't get status
 > reports from my script.
 >

Mmm, no: closing a process stream only closes the process input stream. 
It does not close the process output stream.

See 'gbx_stream_process.c' at line 55:

static int stream_close(STREAM *stream)
{
	if (FDW >= 0)
	{
		if (close(FDW) < 0)
			return TRUE;

		FDW = -1;
	}

	return FALSE;
}

The process output stream is closed only when the process dies for any 
reason.

Do you say that because you don't catch the entire process output from 
Gambas?

-- 
Benoît Minisini




More information about the User mailing list