summaryrefslogtreecommitdiff
path: root/tex/context/base/mkiv/l-file.lua
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2019-12-12 14:10:47 +0100
committerContext Git Mirror Bot <phg@phi-gamma.net>2019-12-12 14:10:47 +0100
commit989909187ebdac48c8cbc65a99840ed58d3f4f46 (patch)
treeb02e8c6f90996f218dd97f8dd2c41e8b6d4a000c /tex/context/base/mkiv/l-file.lua
parente75317d1924dd10388f154df7412a0ab201e455e (diff)
downloadcontext-989909187ebdac48c8cbc65a99840ed58d3f4f46.tar.gz
2019-12-12 13:14:00
Diffstat (limited to 'tex/context/base/mkiv/l-file.lua')
-rw-r--r--tex/context/base/mkiv/l-file.lua20
1 files changed, 15 insertions, 5 deletions
diff --git a/tex/context/base/mkiv/l-file.lua b/tex/context/base/mkiv/l-file.lua
index 1b039a438..d0af94f09 100644
--- a/tex/context/base/mkiv/l-file.lua
+++ b/tex/context/base/mkiv/l-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