[erlang-questions] Getting object code for module in on_init

Björn Gustavsson bjorn@REDACTED
Mon Mar 11 06:04:38 CET 2019

On Sun, Mar 10, 2019 at 3:40 PM Hans Elias B. Josephsen
<hansihe@REDACTED> wrote:
> I am trying to get the object code for a module while inside the `on_init` function of that module.

Do you mean an `on_load` function?

> Normally I would use `code:get_object_code(Module)`, but it seems like the .beam file might not have been written to disk yet at that point.

Works fine for me from an `on_load` function.


Björn Gustavsson, Erlang/OTP, Ericsson AB

More information about the erlang-questions mailing list