X-Git-Url: https://git.archive.openwrt.org/?p=project%2Fluci.git;a=blobdiff_plain;f=libs%2Fcore%2Fluasrc%2Ffs.lua;h=7086088ab28267c4bb0d20264dd8eb81e6493930;hp=35b8289af40204b9ca69174f90eb93dc7b6b450e;hb=53a0f9867af86c6732ff39b466fa2e653b29afe9;hpb=b454395a8da4013aff2ecd64cd7eafc01fc6a5a2 diff --git a/libs/core/luasrc/fs.lua b/libs/core/luasrc/fs.lua index 35b8289af..7086088ab 100644 --- a/libs/core/luasrc/fs.lua +++ b/libs/core/luasrc/fs.lua @@ -27,16 +27,16 @@ limitations under the License. module("luci.fs", package.seeall) require("posix") -posix.umask("rwx------") + +-- Access +access = posix.access -- Glob 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