projects
/
project
/
luci.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
libs/core: Fixed luci.fs.isfile
[project/luci.git]
/
libs
/
core
/
luasrc
/
fs.lua
diff --git
a/libs/core/luasrc/fs.lua
b/libs/core/luasrc/fs.lua
index
415e8e5
..
7086088
100644
(file)
--- 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