libs/core: Fixed luci.fs.isfile

This commit is contained in:
Steven Barth 2008-07-17 18:09:26 +00:00
parent 52d49762ed
commit 53a0f9867a

View file

@ -36,9 +36,7 @@ glob = posix.glob
-- Checks whether a file exists
function isfile(filename)
local fp = io.open(filename, "r")
if fp then fp:close() end
return fp ~= nil
return posix.stat(filename, "type") == "regular"
end
-- Returns the content of file