summaryrefslogtreecommitdiffhomepage
path: root/libs
diff options
context:
space:
mode:
authorSteven Barth <steven@midlink.org>2008-07-17 18:09:26 +0000
committerSteven Barth <steven@midlink.org>2008-07-17 18:09:26 +0000
commit53a0f9867af86c6732ff39b466fa2e653b29afe9 (patch)
tree0f85400e838b4336559dc82578aeffbb61e1b3f6 /libs
parent52d49762ed28033d82e5ab1e0ccf65ad74a4b593 (diff)
libs/core: Fixed luci.fs.isfile
Diffstat (limited to 'libs')
-rw-r--r--libs/core/luasrc/fs.lua4
1 files changed, 1 insertions, 3 deletions
diff --git a/libs/core/luasrc/fs.lua b/libs/core/luasrc/fs.lua
index 415e8e567c..7086088ab2 100644
--- a/libs/core/luasrc/fs.lua
+++ b/libs/core/luasrc/fs.lua
@@ -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