[erlang-questions] Feedback wanted: Remove compilation times from BEAM files in OTP 19?
Björn Gustavsson
bjorn@REDACTED
Fri Apr 8 14:54:26 CEST 2016
On Fri, Apr 8, 2016 at 2:28 PM, Serge Aleynikov <serge@REDACTED> wrote:
> I've been relying on module's compilation time for figuring out the changed
> modules (see below).
>
> In the absence of {time, CompileTime}, would there be a way to determine the
> modification time stamp of the file at the time it was loaded by code
> loader?
Yes. Use Mod:module_info(md5) to calculate MD5 for
the loaded module and compare it to beam_lib:md5(Mod).
Example:
13> c:module_info(md5).
<<79,26,188,243,168,60,58,45,34,69,19,222,138,190,214,118>>
14> beam_lib:md5(code:which(c)).
{ok,{c,<<79,26,188,243,168,60,58,45,34,69,19,222,138,
190,214,118>>}}
/Bjorn
More information about the erlang-questions
mailing list