[erlang-questions] Changing output file for erlc

Gustav Simonsson <>
Mon Jun 24 10:07:06 CEST 2013


Hi,

This prints the compiled beam of foo.erl to stdout and then redirects it to
a file:

erl -noshell -eval '{ok, _, Bin, _} = compile:file("foo", [binary,
return]), file:write_file("/dev/fd/1", Bin), init:stop().' > foo.beam

Cheers,
Gustav Simonsson


On Sat, Jun 22, 2013 at 2:55 PM, Ben Butler-Cole <> wrote:

> Hello
>
> Is it possible to get erlc to change the file that it sends its output to?
> I gather that the directory can be changed with `-o`, but I can't see any
> way to change the file. Equivalently, is it possible to get it to write to
> stdout?
>
> I would like to do this in order to use it with the redo build tool (
> http://homepage.ntlworld.com/jonathan.deboynepollard/FGA/introduction-to-redo.html
> ).
>
> Thanks
> -Ben
>
>
> _______________________________________________
> erlang-questions mailing list
> 
> http://erlang.org/mailman/listinfo/erlang-questions
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20130624/72594bb7/attachment.html>


More information about the erlang-questions mailing list