equal
deleted
inserted
replaced
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) |