summaryrefslogtreecommitdiff
path: root/src/couchdb/couch_util.erl
diff options
context:
space:
mode:
authorPaul Joseph Davis <davisp@apache.org>2009-10-24 04:14:12 +0000
committerPaul Joseph Davis <davisp@apache.org>2009-10-24 04:14:12 +0000
commita883c9aa32f00b10b85dfeefbb0dcb5b890c231a (patch)
tree0fdb172d1a1a54374d4c51eaabdcb7a3357c03c6 /src/couchdb/couch_util.erl
parentdf38ecb4975f250f7a93b7327f8244d618d5ab99 (diff)
Move stat descriptions out of the config.
This lists stat descriptions in an Erlang term file to avoid abusing the config system. Uses a file in CouchDB's priv directory that is a list of three-tuple terms. git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@829304 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/couchdb/couch_util.erl')
-rw-r--r--src/couchdb/couch_util.erl12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/couchdb/couch_util.erl b/src/couchdb/couch_util.erl
index 088fde85..7efc07c0 100644
--- a/src/couchdb/couch_util.erl
+++ b/src/couchdb/couch_util.erl
@@ -12,7 +12,7 @@
-module(couch_util).
--export([start_driver/1,terminate_linked/1]).
+-export([priv_dir/0, start_driver/1,terminate_linked/1]).
-export([should_flush/0, should_flush/1, to_existing_atom/1]).
-export([rand32/0, implode/2, collate/2, collate/3]).
-export([abs_pathname/1,abs_pathname/2, trim/1, ascii_lower/1]).
@@ -27,6 +27,16 @@
% arbitrarily chosen amount of memory to use before flushing to disk
-define(FLUSH_MAX_MEM, 10000000).
+priv_dir() ->
+ case code:priv_dir(couch) of
+ {error, bad_name} ->
+ % small hack, in dev mode "app" is couchdb. Fixing requires
+ % renaming src/couch to src/couch. Not really worth the hassle.
+ % -Damien
+ code:priv_dir(couchdb);
+ Dir -> Dir
+ end.
+
start_driver(LibDir) ->
case erl_ddll:load_driver(LibDir, "couch_erl_driver") of
ok ->