Re: Pipe the content of a variable to a process [message #173036 is a reply to message #173035] |
Fri, 18 March 2011 13:21 |
Jerry Stuckle
Messages: 2598 Registered: September 2010
Karma:
|
Senior Member |
|
|
On 3/18/2011 9:02 AM, Marco wrote:
> On 2011-03-18 Jerry Stuckle<jstucklex(at)attglobal(dot)net> wrote:
>
>>>> What's in stderr? What happens if you write stdout and stderr to a file
>>>> (for testing)?
>>>
>>> They are both empty.
>>>
>>>
>>> Marco
>>>
>>
>>
>> Well, one of the things I see is you're using the -e flag with
>> passthru() but not with proc_open(). That's a huge difference.
>
> It's basically the same. Without »-e« the input goes to standard input, with
> »-e« it goes as a command line input. I think, the problem here is not the
> input, since the return value is zero, it is the missing output.
>
> passthru( "echo 'set terminal svg;plot sin(x)' | gnuplot" );
>
> The line above also produces the desired output.
>
>
> Marco
>
I understand that produces the correct output. But from what I read in
the doc, -e says to use stdin - which is what you're trying to use.
Without -e it goes to the command line, which you are not doing. So
it'd doing exactly what you tell it to do - nothing.
I suggest you ask the gnuplot people. I don't think the problem is the
output stream is failing - I think your commands are incorrect.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex(at)attglobal(dot)net
==================
|
|
|