I have an Erlang application which is run via run_erl. It creates files erlang.pipe.1.w and erlang.pipe.1.r and I can start a console via to_erl. So far, so good. Then I needed to talk to it from a shell script. The obvious thing to do was
#!/bin/sh
EXPR=$1
PIPE_DIR=/tmp/mware
PIPE=$PIPE_DIR/erlang.pipe.1.w
echo $EXPR >> $PIPE
Initially it worked, but now I am getting an error:
-sh: can't create erlang.pipe.1.w: Interrupted system call
ls shows that the file already exists. What’s going wrong and how can I fix it?
Have you tried using a pipe (
|) rather than append (>>). E.g.echo 'io:format("hello ~p", ["world"])' | to_erl $PIPE_DIR