[erlang-questions] Version of beam
Sat Nov 17 10:27:30 CET 2007
Mickaël Rémond <mickael.remond@REDACTED> writes:
> Is there any function (or description of the beam format) allowing to
> know which version of beam bytecode we are dealing with ?
> The idea would be, given a beam file, to know if it is targetting
> Erlang R10 or R11 for example.
Unless the beam-file has been stripped, the easiest way is to look
at the compiler version number in the informatin returned by:
The same information can be obtained by beam_lib like this if you
don't want to load the module to check its version:
If you must be able to deal with beam-files that have been stripped,
you could extract the "Code" chunk from the beam-file, and look at
the field called "opcode_max" in the header for the code.
Björn Gustavsson, Erlang/OTP, Ericsson AB
More information about the erlang-questions