Closed depressed-pho closed 6 years ago
Trying to use {stdin, File} truncates the given file before redirecting the stdin.
{stdin, File}
% echo 'foo' > foo % wc -l foo 4 foo % erl -noinput -eval 'application:ensure_all_started(erlexec), exec:run("cat", [{stdin, "foo"}, sync]), init:stop().' % wc -l foo 0 foo
This has been fixed in the latest commit.
erl -noinput -eval 'application:ensure_all_started(erlexec), io:format("Output: ~p\n", [exec:run("cat", [{stdin, "/tmp/foo"}, sync, stdout])]), init:stop().'
Trying to use
{stdin, File}
truncates the given file before redirecting the stdin.