I would like to execute command on the host machine. I am using the port Module.
I know the file gets executed because the php script is creating log files. But i dont know how to receive the output back to elixir. I can see the data php script outputed only when i use the flush command.
How can i get the data my external programm outputs?
I have tryed System module and the porcelain library, they all work similary to the Port module and the same problem remains.
I can execute my external command. But for some reason I am not getting the output of the exectued script.
However if I use the flush() in elixir I can actualy see the output : {#Port<0.6>, {:data, "some data"}}
Is there any other way besides using the flush command to get the outputed data?
As I said, you can use receive to receive the ports messages manually.
Though I’m wondering why neither System.cmd/3 nor porcelain give you the output, perhaps your tool is only printing output after its stdin has been closed? Then this is exactly what rambo was made for, give it a try.