code:priv_dir()

Bengt Kleberg eleberg@REDACTED
Wed Dec 5 12:43:47 CET 2001


Greetings,

Is there somebody that can expalain why the following code prints:
"{error, bad_name}"

Reading the man page I would have expected
"tmp/cnh2/priv"


bengt

-module(priv_dir).


-export([main/0]).


main( ) ->
	% ignore status, directories may already exist
	file:make_dir("tmp"),
	file:make_dir("tmp/cnh2"),
	file:make_dir("tmp/cnh2/priv"),
	% verify existance
	{ok, _} = file:list_dir("tmp/cnh2/priv"),
	true = code:add_patha("tmp"),
	io:format( "~w~n", [code:priv_dir("cnh2")] ).




More information about the erlang-questions mailing list