diff options
author | Hans Hagen <pragma@wxs.nl> | 2023-03-06 15:17:09 +0100 |
---|---|---|
committer | Context Git Mirror Bot <phg@phi-gamma.net> | 2023-03-06 15:17:09 +0100 |
commit | e12b4fabeb0ce3ce6d256b54250cf38a8f940561 (patch) | |
tree | b574cb45fe8a416e60c912a8e2d754abdad3b63c /tex/context/base/mkiv/l-file.lua | |
parent | 23b5ef45e7939a00addff726d02d6c29243177af (diff) | |
download | context-e12b4fabeb0ce3ce6d256b54250cf38a8f940561.tar.gz |
2023-03-06 14:47:00
Diffstat (limited to 'tex/context/base/mkiv/l-file.lua')
-rw-r--r-- | tex/context/base/mkiv/l-file.lua | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/tex/context/base/mkiv/l-file.lua b/tex/context/base/mkiv/l-file.lua index 9f8fd6548..70f8188dc 100644 --- a/tex/context/base/mkiv/l-file.lua +++ b/tex/context/base/mkiv/l-file.lua @@ -741,8 +741,24 @@ end -- not used in context but was in luatex once: -local symlinkattributes = lfs.symlinkattributes +do + + local symlinktarget = lfs.symlinktarget -- luametatex (always returns string) + local symlinkattributes = lfs.symlinkattributes -- luatex (can return nil) + + if symlinktarget then + function lfs.readlink(name) + local target = symlinktarget(name) + return name ~= target and name or nil + end + elseif symlinkattributes then + function lfs.readlink(name) + return symlinkattributes(name,"target") or nil + end + else + function lfs.readlink(name) + return nil + end + end -function lfs.readlink(name) - return symlinkattributes(name,"target") or nil end |