Add Path to Erlang Search Path?

后端 未结 1 923
日久生厌
日久生厌 2021-01-11 22:59

I recently installed Erlang RFC4627 (JSON-RPC) with the debian package. I ran the test server using:

sudo erl -pa ebin

and then at the pro

1条回答
  •  囚心锁ツ
    2021-01-11 23:47

    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).

    0 讨论(0)
提交回复
热议问题