You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
%Proc{pid: pid,out: {:send,out_pid},err: {:send,err_pid}}=Porcelain.spawn_shell(command,out: {:send,self()},err: {:send,self()})IO.puts"out pid is #{inspectout_pid}, err pid is #{inspecterr_pid}"# out pid is #PID<0.177.0>, err pid is #PID<0.177.0>
I can write a full example with receive etc, but the problem is the same as @markmark206's.
In my case, I'm processing the output with GenServer.handle_info/2;
defhandle_info({pid,:data,:out,data},state)do# do things with pidIO.putsdata{:noreply,state}end@docfalsedefhandle_info({_pid,:data,:err,data},state)doIO.puts"ERROR: #{data}"{:noreply,state}end
The :out messages are being processed, while the err ones aren't.
The stderr ones are being just printed to screen, same as OPs description.
Also, thanks for all the work :)
EDIT: sorry for that! Reading the docs again, I see that :err is not supported for {:send, <pid>} using the basic driver.
markmark206, I think that is how it is intended to work, and Elixir's System.cmd does the same. See ":err – specify the way stderr will be passed back to Elixir." https://hexdocs.pm/porcelain/Porcelain.html
stderr
output produced by the process invoked viaPorcelain.exec
is not captured into result (printed by the program instead).Repro info:
stderr
:(if attempting a repro, please make sure to
chmod +x mine_err.sh
)^^^^ Note:
mine stderr
was printed by the program, but not included in Result.For comparison, when the external program outputs to
stdout
, things work as expected:stdout
:out
, as expected):The text was updated successfully, but these errors were encountered: