summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/luatex/lualibs/lualibs-file.lua
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2020-02-05 21:26:20 +0000
committerKarl Berry <karl@freefriends.org>2020-02-05 21:26:20 +0000
commit37fdb3c6983d960811ba78a31b01b7f44da425ec (patch)
tree11b27035bbea71b641ed87d1a80ac596edcc5b8f /Master/texmf-dist/tex/luatex/lualibs/lualibs-file.lua
parent6ce7aacaa6bc32fac37ae29c2d760f176d446614 (diff)
lualibs (4feb20)
git-svn-id: svn://tug.org/texlive/trunk@53682 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/luatex/lualibs/lualibs-file.lua')
-rw-r--r--Master/texmf-dist/tex/luatex/lualibs/lualibs-file.lua20
1 files changed, 15 insertions, 5 deletions
diff --git a/Master/texmf-dist/tex/luatex/lualibs/lualibs-file.lua b/Master/texmf-dist/tex/luatex/lualibs/lualibs-file.lua
index 1b039a43866..d0af94f09d4 100644
--- a/Master/texmf-dist/tex/luatex/lualibs/lualibs-file.lua
+++ b/Master/texmf-dist/tex/luatex/lualibs/lualibs-file.lua
@@ -76,17 +76,27 @@ local P, R, S, C, Cs, Cp, Cc, Ct = lpeg.P, lpeg.R, lpeg.S, lpeg.C, lpeg.Cs, lpeg
local attributes = lfs.attributes
function lfs.isdir(name)
- return attributes(name,"mode") == "directory"
+ if name then
+ return attributes(name,"mode") == "directory"
+ end
end
function lfs.isfile(name)
- local a = attributes(name,"mode")
- return a == "file" or a == "link" or nil
+ if name then
+ local a = attributes(name,"mode")
+ return a == "file" or a == "link" or nil
+ end
end
function lfs.isfound(name)
- local a = attributes(name,"mode")
- return (a == "file" or a == "link") and name or nil
+ if name then
+ local a = attributes(name,"mode")
+ return (a == "file" or a == "link") and name or nil
+ end
+end
+
+function lfs.modification(name)
+ return name and attributes(name,"modification") or nil
end
if sandbox then