[erlang-questions] Setting the proper source in a module compiled via compile:forms
Thu Mar 22 20:17:33 CET 2012
On 03/22/2012 07:31 PM, José Valim wrote:
> Hello everyone,
> I am using compile:forms() to compile some forms and return me the binary.
> After I load the binary, I can access my code as expected, except the
> mymodule:module_info(:compile) returns the wrong source:
> > mymodule:module_info(compile)
> It seems it is returning my PWD as source. To fix the issue, I have
> already tried:
I think you must use `-file("real/path", Line).' (where Line is an
integer literal). The version with arity 1 (just the file name) is
probably just treated as an unknown user-defined attribute and ignored.
More information about the erlang-questions