tools/ejabberd2prosody.lua

changeset 485
f8456f0da769
parent 484
af499a5ee32f
child 489
237cddb1a785
equal deleted inserted replaced
484:af499a5ee32f 485:f8456f0da769
10 local data_path = "data"; 10 local data_path = "data";
11 dm.set_data_path(data_path); 11 dm.set_data_path(data_path);
12 12
13 local _mkdir = {} 13 local _mkdir = {}
14 function mkdir(path) 14 function mkdir(path)
15 path = path:gsub("/", "\\"); 15 if os.getenv("WINDIR") then
16 -- I'm afraid it's true :(
17 path = path:gsub("/", "\\");
18 end
16 --print("mkdir",path); 19 --print("mkdir",path);
17 local x = io.popen("mkdir "..path.." 2>&1"):read("*a"); 20 local x = io.popen("mkdir "..path.." 2>&1"):read("*a");
18 end 21 end
19 function encode(s) return s and (s:gsub("%W", function (c) return string.format("%%%x", c:byte()); end)); end 22 function encode(s) return s and (s:gsub("%W", function (c) return string.format("%%%x", c:byte()); end)); end
20 function getpath(username, host, datastore, ext) 23 function getpath(username, host, datastore, ext)

mercurial