Software / code / prosody
Comparison
tools/ejabberd2prosody.lua @ 489:237cddb1a785
Fixed the ejabberd importer to work with the pipe sign "|" as a separator in erlang lists
| author | Waqas Hussain <waqas20@gmail.com> |
|---|---|
| date | Sun, 30 Nov 2008 02:08:37 +0500 |
| parent | 485:f8456f0da769 |
| child | 519:cccd610a0ef9 |
comparison
equal
deleted
inserted
replaced
| 485:f8456f0da769 | 489:237cddb1a785 |
|---|---|
| 8 package.loaded["util.logger"] = {init = function() return function() end; end} | 8 package.loaded["util.logger"] = {init = function() return function() end; end} |
| 9 local dm = require "util.datamanager" | 9 local dm = require "util.datamanager" |
| 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 path_separator = "/"; if os.getenv("WINDIR") then path_separator = "\\" end | |
| 13 local _mkdir = {} | 14 local _mkdir = {} |
| 14 function mkdir(path) | 15 function mkdir(path) |
| 15 if os.getenv("WINDIR") then | 16 path = path:gsub("/", path_separator); |
| 16 -- I'm afraid it's true :( | |
| 17 path = path:gsub("/", "\\"); | |
| 18 end | |
| 19 --print("mkdir",path); | 17 --print("mkdir",path); |
| 20 local x = io.popen("mkdir "..path.." 2>&1"):read("*a"); | 18 local x = io.popen("mkdir "..path.." 2>&1"):read("*a"); |
| 21 end | 19 end |
| 22 function encode(s) return s and (s:gsub("%W", function (c) return string.format("%%%x", c:byte()); end)); end | 20 function encode(s) return s and (s:gsub("%W", function (c) return string.format("%%%x", c:byte()); end)); end |
| 23 function getpath(username, host, datastore, ext) | 21 function getpath(username, host, datastore, ext) |