Software /
code /
prosody
Changeset
2159:2ef4458b23d9
util.datamanager: Replace popen(mkdir) with lfs.mkdir, keeping the just-in-time creation until we have the new datamanager API
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Mon, 23 Nov 2009 20:18:04 +0000 |
parents | 2158:575d5db7f14f |
children | 2160:0ef04962e112 2165:529af807ba1a |
files | util/datamanager.lua |
diffstat | 1 files changed, 2 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/util/datamanager.lua Mon Nov 23 19:59:32 2009 +0000 +++ b/util/datamanager.lua Mon Nov 23 20:18:04 2009 +0000 @@ -15,13 +15,13 @@ local log = require "util.logger".init("datamanager"); local io_open = io.open; local os_remove = os.remove; -local io_popen = io.popen; local tostring, tonumber = tostring, tonumber; local error = error; local next = next; local t_insert = table.insert; local append = require "util.serialization".append; local path_separator = "/"; if os.getenv("WINDIR") then path_separator = "\\" end +local lfs_mkdir = require "lfs".mkdir; module "datamanager" @@ -43,7 +43,7 @@ local function mkdir(path) path = path:gsub("/", path_separator); -- TODO as an optimization, do this during path creation rather than here if not _mkdir[path] then - local x = io_popen("mkdir \""..path.."\" 2>&1"):read("*a"); + lfs_mkdir(path); _mkdir[path] = true; end return path;