[erlang-questions] Problem with code:priv_dir
Wed Feb 14 14:52:45 CET 2007
code:priv_dir(Name) does not search *the directories* in the code path
for a directory named Name. It searches *the list of names* which
constitute the code path, and if there is a directory in the code path
called "something/Name" it returns "something/Name/priv".
I agree the documentation could be more clear on this...
Gunilla, Erlang/OTP team
Robert Baruch wrote:
> Hi all,
> Here's my scenario, running R11B-2. In my home directory, I have the
> following directories:
> Now, I fire up the erl shell and try to run code:priv_dir(mytest):
> ekmac:~ ek$ erl
> Erlang (BEAM) emulator version 5.5.2 [source] [async-threads:0]
> [hipe] [kernel-poll:false]
> Eshell V5.5.2 (abort with ^G)
> 1> code:priv_dir(mytest).
> 2> code:get_path().
> (and so on)
> Now, what I don't get is that the documentation for code:priv_dir/1
> "Searches the code path for a directory named .../Name[-Vsn][/ebin]
> and returns the directory .../Name[-Vsn]/priv. It is not checked if
> this directory really exists."
> Code path contains "." ... check.
> ./mytest-0.1/ebin ... check.
> So why isn't priv_dir/1 returning "./mytest-0.1/priv"?
> Thanks for any help!
More information about the erlang-questions