From b5cf596d6c17fc9c8b7c679fe445a9c70af2a16e Mon Sep 17 00:00:00 2001 From: Kaarle Ritvanen Date: Wed, 1 May 2013 11:44:11 +0300 Subject: allow numerical components in path names use escape syntax to encode number-looking strings --- acf/persistence/backends/files.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'acf/persistence/backends/files.lua') diff --git a/acf/persistence/backends/files.lua b/acf/persistence/backends/files.lua index 03eadff..e123e21 100644 --- a/acf/persistence/backends/files.lua +++ b/acf/persistence/backends/files.lua @@ -17,7 +17,7 @@ backend = require('acf.object').class() function backend:init() self.cache = {} end function backend:get(path, tpe) - local name = pth.mjoin('/', unpack(path)) + local name = pth.join('/', unpack(path)) if not self.cache[name] then local t = posix.stat(name, 'type') @@ -30,7 +30,7 @@ function backend:get(path, tpe) local res = {} for _, fname in ipairs(posix.dir(name)) do if not ({['.']=true, ['..']=true})[fname] then - table.insert(res, fname) + table.insert(res, pth.name(fname)) end end return res @@ -46,7 +46,7 @@ end function backend:set(mods) for _, mod in pairs(mods) do local path, t, value = unpack(mod) - local name = pth.mjoin('/', unpack(path)) + local name = pth.join('/', unpack(path)) -- TODO save references (t == 'reference') as symlinks -- cgit v1.2.3