Comparison

util/datamanager.lua @ 4093:36555949bd16

util.datamanager: Use prosody.paths.data as the initial value for data_path
author Matthew Wild <mwild1@gmail.com>
date Fri, 07 Jan 2011 11:55:19 +0000
parent 3845:4860853fc97b
child 4108:e3e3aa286334
comparison
equal deleted inserted replaced
4091:c53610fdab62 4093:36555949bd16
20 local next = next; 20 local next = next;
21 local t_insert = table.insert; 21 local t_insert = table.insert;
22 local append = require "util.serialization".append; 22 local append = require "util.serialization".append;
23 local path_separator = "/"; if os.getenv("WINDIR") then path_separator = "\\" end 23 local path_separator = "/"; if os.getenv("WINDIR") then path_separator = "\\" end
24 local lfs = require "lfs"; 24 local lfs = require "lfs";
25 local prosody = prosody;
25 local raw_mkdir; 26 local raw_mkdir;
26 27
27 if prosody.platform == "posix" then 28 if prosody.platform == "posix" then
28 raw_mkdir = require "util.pposix".mkdir; -- Doesn't trample on umask 29 raw_mkdir = require "util.pposix".mkdir; -- Doesn't trample on umask
29 else 30 else
54 _mkdir[path] = true; 55 _mkdir[path] = true;
55 end 56 end
56 return path; 57 return path;
57 end 58 end
58 59
59 local data_path = "data"; 60 local data_path = prosody.paths.data;
60 local callbacks = {}; 61 local callbacks = {};
61 62
62 ------- API ------------- 63 ------- API -------------
63 64
64 function set_data_path(path) 65 function set_data_path(path)