libs/core: Fixed luci.fs.isfile
This commit is contained in:
parent
52d49762ed
commit
53a0f9867a
1 changed files with 1 additions and 3 deletions
|
@ -36,9 +36,7 @@ glob = posix.glob
|
||||||
|
|
||||||
-- Checks whether a file exists
|
-- Checks whether a file exists
|
||||||
function isfile(filename)
|
function isfile(filename)
|
||||||
local fp = io.open(filename, "r")
|
return posix.stat(filename, "type") == "regular"
|
||||||
if fp then fp:close() end
|
|
||||||
return fp ~= nil
|
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Returns the content of file
|
-- Returns the content of file
|
||||||
|
|
Loading…
Reference in a new issue