Run command line command synchronously with Elixir / Erlang

I want to execute a (slow) python script, and I want my Elixir process to lock until it gets all the output from the script.

Are the Elixir System.cmd / 3 or Erlang os: cmd / 1 algorithms synchronous? If not, is there another way to make a os synchronous call?

+5
source share
1 answer

os: cmd

Executes a command in the command shell of the target OS, captures the standard output of the command, and returns this result as a string. This function replaces the previous unix: cmd / 1; on Unix platforms they are equivalent.

This command is synchronous.

+7
source

Source: https://habr.com/ru/post/1240818/


All Articles