简体   繁体   中英

How do I access .beam files from other directories in Erlang?

I have successfully compiled my .erl files and now the .beam files are lying down in my working directory. However, for some reason I need to access those files from another directory... more specifically from the parent directory. The hierarchy is: ...\wkdir\ebin\beam_example.beam , and I wish to access the beam_example.beam from wkdir . Is it possible to do this?

Also, I'm using escript, so a valid import may be very likely to solve this problem, though I just can't figure that out.

You can modify the search path for the .beam with the code:add_path* methods . If the code server is in interactive mode (it should be), that'd be enough for the VM to locate the module files and load them lazily.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM