[erlang-questions] Run external program with arguments

Bob Ippolito <>
Wed Nov 14 16:16:14 CET 2007


The easiest way is to perform shell quoting over the command you
want... take a look at mochiweb_util:cmd_port/2.

http://mochiweb.googlecode.com/svn/trunk/src/mochiweb_util.erl

-bob

On 11/14/07, Alexander Zhukov <> wrote:
> Hi!
>
> Is there a way to run an external program from Erlang program with
> arguments?
>
> I like to be able to write something like this:
>
> Port = open_port({spawn, Ext_prog_name}, [stream, {args, ["-c", "file", "-d"]}]),
>
> but so far I can't find a way to run a program with arguments.
>
> Yes, I know I can write a wrapper script but I do not like such an
> approach.
>
> --
> Alexander Zhukov
> _______________________________________________
> erlang-questions mailing list
> 
> http://www.erlang.org/mailman/listinfo/erlang-questions
>



More information about the erlang-questions mailing list