diff options
author | Norbert Preining <norbert@preining.info> | 2020-02-04 03:01:28 +0000 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2020-02-04 03:01:28 +0000 |
commit | fc358ce7332053945afe16ced2a271556cdccfb7 (patch) | |
tree | d723e8bbffaaffd6c8c6d51d46c54db70c61f67a /macros/luatex/generic/lualibs/lualibs-file.lua | |
parent | 34897eebd22c3de968b64f09bb4a371d96cb0b89 (diff) |
CTAN sync 202002040301
Diffstat (limited to 'macros/luatex/generic/lualibs/lualibs-file.lua')
-rw-r--r-- | macros/luatex/generic/lualibs/lualibs-file.lua | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/macros/luatex/generic/lualibs/lualibs-file.lua b/macros/luatex/generic/lualibs/lualibs-file.lua index 1b039a4386..d0af94f09d 100644 --- a/macros/luatex/generic/lualibs/lualibs-file.lua +++ b/macros/luatex/generic/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 |