Add Path to Erlang Search Path?

一世执手 提交于 2019-12-01 03:21:56

The code module is how you manipulate the path within an application.

The flags -pa that you used in starting the Erlang shell actually refer to a function in this module:

add_patha(Dir) -> true | {error, What}

You are right about the .erlang file in your home directory - it is run at start-up time of the shell and you can add in handy paths.

For an application you can start the shell with a batch file that calls something like this:

erl -pa ./ebin ../../lib/some/path/ebin

The flags behaviour of erl is described here.

For more sophisticated path management you need to get familiar with how OTP release management is done (but I suspect that is a while away for you yet).

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!