[erlang-questions] Problem with code:priv_dir

Robert Baruch <>
Sun Feb 11 21:55:54 CET 2007


Hi all,

Here's my scenario, running R11B-2. In my home directory, I have the  
following directories:

mytest-0.1/
mytest-0.1/ebin/

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).
{error,bad_name}
2> code:get_path().
[".",
"/usr/local/lib/erlang/lib/kernel-2.11.2/ebin",
"/usr/local/lib/erlang/lib/stdlib-1.14.2/ebin",
"/usr/local/lib/erlang/lib/xmerl-1.0.5/ebin",
(and so on)

Now, what I don't get is that the documentation for code:priv_dir/1  
says:

"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!

--Rob





More information about the erlang-questions mailing list