[erlang-questions] erlang_port
eigenfunction
emeka_1978@REDACTED
Mon Dec 19 14:49:16 CET 2011
Thank you so much. Now i can go back to doing real work.
On Dec 19, 12:25 pm, Robert Raschke <rtrli...@REDACTED> wrote:
> On Mon, Dec 19, 2011 at 9:36 AM, eigenfunction <emeka_1...@REDACTED> wrote:
> > I am trying to control a window os process with erlang. Can someone
> > explain this to me:
> > os:cmd("startwww.yahoo.com") is working;
> > erlang_port({spawn,"startwww.yahoo.com"},[exit_status]) is not
> > working and throws an exception error: enoent.
> > Thx.
>
> Try this:
>
> erlang:open_port({spawn,"cmd /c startwww.yahoo.com"},[exit_status]).
>
> The "start" command is a windows command shell builtin, not an executable.
> So you have to run it in a shell, which os:cmd/1 does automatically for
> you, but erlang:open_port/2 doesn't. And enoent in this context means that
> the exe named "start" could not be found.
>
> Have fun,
> Robby
>
> _______________________________________________
> erlang-questions mailing list
> erlang-questi...@REDACTED://erlang.org/mailman/listinfo/erlang-questions
More information about the erlang-questions
mailing list