aboutsummaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2008-11-28 18:06:29 +0000
committerMatthew Wild <mwild1@gmail.com>2008-11-28 18:06:29 +0000
commit121e93a07ad29500c1b8e1c56efff7055cf324bc (patch)
tree47871ab0d4c73c83e2f231a6f62b9f3b7dcd730b /util
parent77c094c25a133609d7b30b748d62f4e9a78775b5 (diff)
parente26768484b03eaa827f59b85d367fabbb43fdc88 (diff)
downloadprosody-121e93a07ad29500c1b8e1c56efff7055cf324bc.tar.gz
prosody-121e93a07ad29500c1b8e1c56efff7055cf324bc.zip
Merge from waqas
Diffstat (limited to 'util')
-rw-r--r--util/datamanager.lua12
1 files changed, 9 insertions, 3 deletions
diff --git a/util/datamanager.lua b/util/datamanager.lua
index 80b35733..f25fffb3 100644
--- a/util/datamanager.lua
+++ b/util/datamanager.lua
@@ -17,6 +17,8 @@ local indent = function(f, i)
end
end
+local data_path = "data";
+
module "datamanager"
@@ -70,14 +72,18 @@ end
------- API -------------
+function set_data_path(path)
+ data_path = path;
+end
+
function getpath(username, host, datastore, ext)
ext = ext or "dat";
if username then
- return format("data/%s/%s/%s.%s", encode(host), datastore, encode(username), ext);
+ return format("%s/%s/%s/%s.%s", data_path, encode(host), datastore, encode(username), ext);
elseif host then
- return format("data/%s/%s.%s", encode(host), datastore, ext);
+ return format("%s/%s/%s.%s", data_path, encode(host), datastore, ext);
else
- return format("data/%s.%s", datastore, ext);
+ return format("%s/%s.%s", data_path, datastore, ext);
end
end