diff options
Diffstat (limited to 'tex/context/base/x-dir-05.mkiv')
-rw-r--r-- | tex/context/base/x-dir-05.mkiv | 74 |
1 files changed, 0 insertions, 74 deletions
diff --git a/tex/context/base/x-dir-05.mkiv b/tex/context/base/x-dir-05.mkiv deleted file mode 100644 index 379b3220a..000000000 --- a/tex/context/base/x-dir-05.mkiv +++ /dev/null @@ -1,74 +0,0 @@ -%D \module -%D [ file=x-dir-05, -%D version=2003.05.10, % around that time -) -%D title=\CONTEXT\ Directory Handling, -%D subtitle=Access, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -\setvariables - [filestate] - [name=, - base=, - type=, - size=, - permissions=, - date=] - -% \savefilestate[zip-latest][context/latest/cont-#2.zip]% - -% TODO: move to module namespace - -\startluacode - local filestates = { } - function commands.savefilestate(tag,name) - if not filestates[tag] then - local attr = lfs.attributes(name) - if attr then attr.name = name end - filestates[tag] = attr - end - end - function commands.getfilestatevariable(tag,name) - local fs = filestates[tag] - if fs then - local value - if name == "base" then - value = file.basename(fs.name) - elseif name == "type" then - value = file.extname(fs.name) - elseif name == "date" then - value = os.date("%Y-%m-%d %H:%M",fs.modification) - else - value = fs[name] or "" - end - context.sprint(tex.vrbcatcodes,value) - end - end -\stopluacode - -\def\getfilestatevariable#1#2% - {\ctxcommand{getfilestatevariable("#1","#2")}} - -\def\savefilestate - {\dodoubleargument\dosavefilestate} - -\def\dosavefilestate[#1][#2]% - {\ctxcommand{savefilestate("#1","#2")}% - \setxvariables - [#1] - [name={#2}, - base=\getfilestatevariable{#1}{base}, - type=\getfilestatevariable{#1}{type}, - size=\getfilestatevariable{#1}{size}, - date=\getfilestatevariable{#1}{date}, - permissions=\getfilestatevariable{#1}{permissions}]} - -\def\getfilestate#1% old one - {\savefilestate[filestate][#1]} - -\endinput |