Mercurial > prosody-hg
comparison util/datamanager.lua @ 4097:2d3866aed062
Merge 0.8->trunk
| author | Matthew Wild <mwild1@gmail.com> |
|---|---|
| date | Fri, 07 Jan 2011 11:59:05 +0000 |
| parents | 36555949bd16 |
| children | e3e3aa286334 |
comparison
equal
deleted
inserted
replaced
| 4092:d78d5038d144 | 4097:2d3866aed062 |
|---|---|
| 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) |
