summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/filemod/filemod.sty
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/latex/filemod/filemod.sty')
-rw-r--r--Master/texmf-dist/tex/latex/filemod/filemod.sty89
1 files changed, 65 insertions, 24 deletions
diff --git a/Master/texmf-dist/tex/latex/filemod/filemod.sty b/Master/texmf-dist/tex/latex/filemod/filemod.sty
index cb90336c925..3fa49d20fed 100644
--- a/Master/texmf-dist/tex/latex/filemod/filemod.sty
+++ b/Master/texmf-dist/tex/latex/filemod/filemod.sty
@@ -15,11 +15,36 @@
%% This work consists of the files filemod.dtx and filemod.ins
%% and the derived filebase filemod.sty.
\ProvidesPackage{filemod}[%
- 2011/03/23 v1.0
+ 2011/03/24 v1.1
Get and compare file modification times]
-\newcommand*\filemodparse[2]{%
+\ifx\filemod@directtrue\@undefined
+\csname newif\expandafter\endcsname\csname iffilemod@direct\endcsname
+\filemod@directtrue
+\ifx\pdffilemoddate\@undefined
+ \RequirePackage{pdftexcmds}
+ \filemod@directfalse
+ \ifx\pdf@filemoddate\@undefined
+ \edef\filemod@help
+ {The required command \string\pdffilemoddate\space is not defined.
+ This means that the used\space\space LaTeX compiler does not support it.
+ Please make sure that pdfLaTeX 1.30.0 or\space\space\space newer or LuaLaTeX is used.
+ XeLaTeX does not support reading file modification\space\space dates.
+ }%
+ \PackageError{filemod}{Required command \string\pdffilemoddate\space is not defined!}{\filemod@help}
+ \fi
+\fi
+\fi
+\newcommand*\filemodparse{}
+\iffilemod@direct
+\def\filemodparse#1#2{%
\expandafter\filemod@parse\pdffilemoddate{#2}\relax{#1}%
}
+\else
+\def\filemodparse#1#2{%
+ \expandafter\expandafter
+ \expandafter\filemod@parse\pdf@filemoddate{#2}\relax{#1}%
+}
+\fi
\def\filemod@parse#1\relax#2{%
\ifx\relax#1\relax
\expandafter\@firstoftwo
@@ -30,12 +55,13 @@
{\filemod@parse@#1\empty{#2}\relax}%
}
\begingroup
-\@makeother\D
-\@makeother\Z
-\@makeother:
+\catcode`\D=12
+\catcode`\Z=12
+\catcode`\:=12
\gdef\filemod@parse@ D:#1#2#3#4#5#6#7#8#9\relax{%
\filemod@parse@@{{#1#2#3#4}{#5#6}{#7#8}}#9\relax
}
+\newcommand*\filemodnotexists{}
\gdef\filemodnotexists#1{%
#1{0000}{00}{00}{00}{00}{00}{Z}%
}
@@ -44,9 +70,11 @@
#9#1{#2#3}{#4#5}{#6#7}{#8}%
}
\RequirePackage{filemod-expmin}
-\newcommand*\filemodnumdate{\filemodparse\filemod@numdate}
+\newcommand*%
+\filemodnumdate{\filemodparse\filemod@numdate}
\def\filemod@numdate#1#2#3#4#5#6#7{#1#2#3}
-\newcommand*\filemodnumtime{\filemodparse\filemod@numtime}
+\newcommand*%
+\filemodnumtime{\filemodparse\filemod@numtime}
\def\filemod@numtime#1#2#3#4#5#6#7{#4#5#6}
\def\filemod@opt#1#2#3{%
\expandafter
@@ -64,10 +92,12 @@
\expandafter#2
\fi
}
-\newcommand*\filemodcmp{%
+\newcommand*%
+\filemodcmp{%
\filemod@opt\filemod@cmp@opt\filemod@cmp
}
-\newcommand*\filemodoptdefault{1}
+\newcommand*%
+\filemodoptdefault{1}
\def\filemod@cmp@opt#1#2]{%
\filemod@cmp{#2}%
}
@@ -102,7 +132,8 @@
}
\long\def\@firstofthree#1#2#3{#1}
\long\def\@secondofthree#1#2#3{#2}
-\newcommand*\filemodnewest{%
+\newcommand*%
+\filemodnewest{%
\filemod@opt\filemod@newest@opt\filemod@newest
}
\def\filemod@newest@opt#1#2]{%
@@ -111,7 +142,8 @@
\def\filemod@newest#1#2#3{%
\filemod@@cmp>{#1}{#2}{#3}{#2}{#3}%
}
-\newcommand*\filemodoldest{%
+\newcommand*%
+\filemodoldest{%
\filemod@opt\filemod@oldest@opt\filemod@oldest
}
\def\filemod@oldest@opt#1#2]{%
@@ -204,7 +236,8 @@
\fi
}
\def\filemod@end{\@gobble{filemod@end}}
-\newcommand*\Filemodgetnum{\filemodparse\Filemod@getnum}
+\newcommand*%
+\Filemodgetnum{\filemodparse\Filemod@getnum}
\def\Filemod@getnum#1#2#3#4#5#6#7{%
\def\filemoddate{#1#2#3}%
\def\filemodtime{#4#5#6}%
@@ -264,12 +297,14 @@
}
\newcommand*\Filemodnewest[3][\filemodoptdefault]{\FilemodNewest[{#1}]{{#2}{#3}}}
\newcommand*\Filemodoldest[3][\filemodoptdefault]{\FilemodOldest[{#1}]{{#2}{#3}}}
-\newcommand*\FilemodNewest[2][\filemodoptdefault]{%
+\newcommand*\FilemodNewest[2][\filemodoptdefault]%
+{%
\def\filemode@tie{#1}%
\def\filemod@gl{>}%
\Filemod@est#2\filemod@end
}
-\newcommand*\FilemodOldest[2][\filemodoptdefault]{%
+\newcommand*\FilemodOldest[2][\filemodoptdefault]%
+{%
\def\filemode@tie{#1}%
\def\filemod@gl{<}%
\Filemod@est#2\filemod@end
@@ -303,19 +338,23 @@
}%
}
\def\filemod@gl{>}
-\newcommand*\filemodprint{\filemodparse\thefilemod}
-\newcommand*\filemodprintdate{\filemodparse\the@filemoddate}
-\newcommand*\filemodprinttime{\filemodparse\the@filemodtime}
-\newcommand*\thefilemod[7]{%
+\newcommand*
+\filemodprint{\filemodparse\thefilemod}
+\newcommand*
+\filemodprintdate{\filemodparse\the@filemoddate}
+\newcommand*
+\filemodprinttime{\filemodparse\the@filemodtime}
+\newcommand*\thefilemod[7]%
+{%
\thefilemoddate{#1}{#2}{#3}%
\filemodsep
\thefilemodtime{#4}{#5}{#6}{#7}%
}
-\let\filemodsep\space
-\newcommand*\thefilemoddate[3]{%
- #1/#2/#3%
-}
-\newcommand*\thefilemodtime[4]{%
+\newcommand*\filemodsep{ }
+\newcommand*\thefilemoddate[3]%
+{#1/#2/#3}
+\newcommand*\thefilemodtime[4]%
+{%
#1:#2:#3~#4%
}
\def\the@filemoddate#1#2#3#4#5#6#7{%
@@ -324,8 +363,10 @@
\def\the@filemodtime#1#2#3{%
\thefilemodtime
}
+\newcommand*\filemodZ{}
+\newcommand*\filemodz{}
\begingroup
-\@makeother\D
+\catcode`\D=12
\expandafter\gdef\csname filemodZ\endcsname{Z}%
\let\filemodz=Z\relax
\endgroup