From 16c5401b2e981c96abd62e86e557fbbc50124dc2 Mon Sep 17 00:00:00 2001 From: zengxiangbin Date: Wed, 25 Oct 2017 16:10:49 +0800 Subject: [PATCH] fix #1 --- flatdb.lua | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/flatdb.lua b/flatdb.lua index 7414953..60916f5 100644 --- a/flatdb.lua +++ b/flatdb.lua @@ -10,11 +10,9 @@ local function isFile(path) end local function isDir(path) - local tmp = path.."/"..os.tmpname() - local f = io.open(tmp, "w") - if f then - f:close() - os.remove(tmp) + path = string.gsub(path.."/", "//", "/") + local ok, err, code = os.rename(path, path) + if ok or code == 13 then return true end return false