<div dir="ltr">First, if you run code:which(ModuleName) for any module of the <span style="font-size:12.8px;text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">app, it should show you a path that ends in .../APPNAME[-VSN]/ebin/ModuleName.ebin - if it doesn't, code:priv_dir(APPNAME) won't recognize the name as an app and you'll get {error, bad_name}. </span><span style="font-size:12.8px">For example: code:which(lists) -> </span><span style="font-size:12.8px">".../stdlib-3.4/ebin/lists.beam", code:priv_dir(stdlib) -> ".../stdlib-3.4/priv". This should work even if the priv directory doesn't in fact exist (stdlib does not have one).</span><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">Second, for ERL_LIBS to work, it should point out the directory above your set of applications, as in ".../lib", not an ebin directory or a single app directory. Directories under ERL_LIBS that contain an ebin subdirectory will be recognized as apps, and their ebins will be added to the path.<br></span><div><br></div></div><div>Hope this helps.</div><div><br></div></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature" data-smartmail="gmail_signature"><br> /Richard</div></div>
<br><div class="gmail_quote">2018-06-20 22:58 GMT+02:00 Bob Cowdery <span dir="ltr"><<a href="mailto:bob@bobcowdery.plus.com" target="_blank">bob@bobcowdery.plus.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div text="#000000" bgcolor="#FFFFFF">
<p>This code:priv_dir/1 has me completely baffled. The code for
gen_serial will only resolve the directory if I leave it in its
original directory and add the ebin to the code path. If I move
the files to my own tree it wont give me anything except {error,
bad_name}. I've put in the correct directory structure according
to the docs, added an Application.app file and tried various names
in the call including ?MODULE, the file I am running and the app
name. I also added the ebin path to ERL_LIBS to no avail.</p>
<p>There is also some weird thing going on with the paths. Even if I
remove the gen_serial original code path from .erlang and then
build it from some random directory it still builds that one even
though I have a copy in my tree and the code path only points
there. Is there some cache somewhere?</p>
<br>
<div class="m_-5730129840854758853moz-cite-prefix">On 6/19/2018 8:40 PM, Vance Shipley
wrote:<br>
</div>
<blockquote type="cite">
<div dir="auto">Heh, I just posted about this in another thread.
You probably have a problem related to your installed path. It's
not enough to set the code path, you need to include the parent
directory in the ERL_LIBS environment variable.
<div dir="auto"><br>
</div>
</div>
<br>
<div class="gmail_quote">
<div dir="ltr">On Tue, Jun 19, 2018, 01:52 Bob Cowdery <<a href="mailto:bob@bobcowdery.plus.com" target="_blank">bob@bobcowdery.plus.com</a>>
wrote:<br>
</div>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
I'm trying to get gen_serial up and running. I've tracked the
problem <br>
down to a line which boils down to code:priv_dir(gen_serial).<br>
<br>
This is intending to get the port executable path but returns
bad_name. <br>
Why would this call fail?<br>
<br>
Thanks<br>
<br>
BobC<br>
<br>
______________________________<wbr>_________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org" rel="noreferrer" target="_blank">erlang-questions@erlang.org</a><br>
<a href="http://erlang.org/mailman/listinfo/erlang-questions" rel="noreferrer noreferrer" target="_blank">http://erlang.org/mailman/<wbr>listinfo/erlang-questions</a><br>
</blockquote>
</div>
</blockquote>
<br>
</div>
<br>______________________________<wbr>_________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br>
<a href="http://erlang.org/mailman/listinfo/erlang-questions" rel="noreferrer" target="_blank">http://erlang.org/mailman/<wbr>listinfo/erlang-questions</a><br>
<br></blockquote></div><br></div>