From 13eb04abbc9d8561e44786ce9b0dd94bc1454e1f Mon Sep 17 00:00:00 2001 From: Kaarle Ritvanen Date: Fri, 26 Apr 2013 16:07:10 +0300 Subject: substitute lua-posix for lua-filesystem --- acf/persistence/backends/json.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'acf/persistence/backends/json.lua') diff --git a/acf/persistence/backends/json.lua b/acf/persistence/backends/json.lua index 299cf72..1ac977e 100644 --- a/acf/persistence/backends/json.lua +++ b/acf/persistence/backends/json.lua @@ -11,7 +11,7 @@ local util = require('acf.persistence.util') local copy = require('acf.util').copy require 'json' -require 'lfs' +require 'posix' backend = require('acf.object').class() @@ -40,12 +40,12 @@ function backend:split_path(path) fpath = pth.mjoin(fpath, jpath[1]) table.remove(jpath, 1) - local attrs = lfs.attributes(fpath) - if not attrs or not ({directory=true, file=true})[attrs.mode] then + local t = posix.stat(fpath, 'type') + if not t or not ({directory=true, regular=true})[t] then error('File or directory does not exist: '..fpath) end - if attrs.mode == 'file' then return fpath, jpath end + if t == 'regular' then return fpath, jpath end assert(#jpath > 0) end -- cgit v1.2.3