Vance Shipley vances@REDACTED
Wed Dec 5 18:04:07 CET 2001

> 4> code:add_path("tmp/cnh2").
> true
> 5> code:priv_dir(cnh2).
> "tmp/cnh2/priv"

The documentation for code:priv_dir/1 explicitly says that you
will get "/priv" appended to the directory name.  What you will
get out this function is the full, possibly expanded, name of 
the priv directory.

1> file:make_dir("tmp").
2> file:make_dir("tmp/cnh2-3.4.5").
3> code:add_path("tmp/cnh2-3.4.5").
4> code:priv_dir(cnh2).

It doesn't even have to exist!

	priv_dir(Name) -> PrivDir | {error, What}

	This function returns the current priv directory for the 
	Name[-*] directory. The current path is searched for a 
	directory named .../Name-* (the -* suffix is optional for 
	directories in the search path and it represents the version 
	of the directory). The /priv suffix is added to the end of 
	the found directory.

The thing to realize is that the priv directory is for storing data.
We put some of our mnesia tables there (if they're small enough).

The ebin directory is where your .beam files belong.  You want to add
"tmp/cnh2-3.4.5/ebin" directory to the path.  If you later want to 
find out what the path name to the cnh2 data files is you run:

4> code:priv_dir(cnh2).

And you find out the full path including any trailing version numbers.

The directory structures is documented in:

	A release should be divided into the following directories: 


	The ebin directory contains the Erlang object code and the 
	application resource file. 

	The priv directory contains any application private data. 
	Specifically, port programs should be located in the priv directory. 
	The priv directory of an application is found by a call to 


Vance Shipley
Motivity Telecom Inc.
+1 519 579 5816

More information about the erlang-questions mailing list