summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/l3kernel/l3file.dtx
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/source/latex/l3kernel/l3file.dtx')
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3file.dtx109
1 files changed, 20 insertions, 89 deletions
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3file.dtx b/Master/texmf-dist/source/latex/l3kernel/l3file.dtx
index 67d708da28a..d96d9c7e31e 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3file.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3file.dtx
@@ -44,7 +44,7 @@
% }^^A
% }
%
-% \date{Released 2020-09-06}
+% \date{Released 2020-09-24}
%
% \maketitle
%
@@ -2636,18 +2636,9 @@
% \end{macro}
%
% \begin{macro}{\@@_size:n}
-% A copy of the primitive where it's available, or the \LuaTeX{}
-% equivalent if relevant.
+% A copy of the primitive where it's available.
% \begin{macrocode}
\cs_new_eq:NN \@@_size:n \tex_filesize:D
-\sys_if_engine_luatex:T
- {
- \cs_gset:Npn \@@_size:n #1
- {
- \lua_now:e
- { l3kernel.filesize ( " \lua_escape:e {#1} " ) }
- }
- }
% \end{macrocode}
% \end{macro}
%
@@ -2753,9 +2744,7 @@
% \end{macrocode}
% Deal with the fact that the primitive might not be available.
% \begin{macrocode}
-\bool_lazy_or:nnF
- { \cs_if_exist_p:N \tex_filesize:D }
- { \sys_if_engine_luatex_p: }
+\cs_if_exist:NF \tex_filesize:D
{
\cs_gset:Npn \file_full_name:n #1
{
@@ -2817,9 +2806,7 @@
% existence of the file with |.tex| extension in that directory, and
% if it exists we include the |.tex| extension in the result.
% \begin{macrocode}
-\bool_lazy_or:nnF
- { \cs_if_exist_p:N \tex_filesize:D }
- { \sys_if_engine_luatex_p: }
+\cs_if_exist:NF \tex_filesize:D
{
\prg_set_protected_conditional:Npnn \file_get_full_name:nN #1#2 { T , F , TF }
{
@@ -2882,8 +2869,6 @@
% As the MD5 function has a slightly different syntax from the other commands,
% there is a little cleaning up to do.
% \begin{macrocode}
-\cs_new:Npn \file_mdfive_hash:n #1
- { \@@_details:nn {#1} { mdfivesum } }
\cs_new:Npn \file_size:n #1
{ \@@_details:nn {#1} { size } }
\cs_new:Npn \file_timestamp:n #1
@@ -2898,20 +2883,10 @@
\tl_if_blank:nF {#1}
{ \use:c { tex_file #2 :D } {#1} }
}
-\sys_if_engine_luatex:TF
- {
- \cs_gset:Npn \@@_details_aux:nn #1#2
- {
- \lua_now:e
- { l3kernel.file#2 ( " \lua_escape:e { #1 } " ) }
- }
- }
- {
- \cs_gset:Npn \file_mdfive_hash:n #1
- { \exp_args:Ne \@@_mdfive_hash:n { \file_full_name:n {#1} } }
- \cs_new:Npn \@@_mdfive_hash:n #1
- { \tex_mdfivesum:D file {#1} }
- }
+\cs_new:Npn \file_mdfive_hash:n #1
+ { \exp_args:Ne \@@_mdfive_hash:n { \file_full_name:n {#1} } }
+\cs_new:Npn \@@_mdfive_hash:n #1
+ { \tex_mdfivesum:D file {#1} }
% \end{macrocode}
% \end{macro}
% \end{macro}
@@ -2973,34 +2948,21 @@
length ~ \int_eval:n { #1 - #2 + 1 }
{#3}
}
-\sys_if_engine_luatex:T
- {
- \cs_gset:Npn \@@_hex_dump_auxiv:nnn #1#2#3
- {
- \lua_now:e
- {
- l3kernel.filedump
- (
- " \lua_escape:e {#3} " ,
- \int_eval:n { #2 - 1 } ,
- \int_eval:n { #1 - #2 + 1 }
- )
- }
- }
- }
\cs_new:Npn \file_hex_dump:n #1
{ \exp_args:Ne \@@_hex_dump:n { \file_full_name:n {#1} } }
-\cs_new:Npn \@@_hex_dump:n #1
+\sys_if_engine_luatex:TF
{
- \tl_if_blank:nF {#1}
- { \tex_filedump:D length \tex_filesize:D {#1} {#1} }
+ \cs_new:Npn \@@_hex_dump:n #1
+ {
+ \tl_if_blank:nF {#1}
+ { \tex_filedump:D whole {#1} {#1} }
+ }
}
-\sys_if_engine_luatex:T
{
- \cs_gset:Npn \@@_hex_dump:n #1
+ \cs_new:Npn \@@_hex_dump:n #1
{
- \lua_now:e
- { l3kernel.filedump ( " \lua_escape:e { #1 } " ) }
+ \tl_if_blank:nF {#1}
+ { \tex_filedump:D length \tex_filesize:D {#1} {#1} }
}
}
% \end{macrocode}
@@ -3048,9 +3010,7 @@
% Where the primitive is not available, issue an error: this is a little
% more conservative than absolutely needed, but does work.
% \begin{macrocode}
-\bool_lazy_or:nnF
- { \cs_if_exist_p:N \tex_filesize:D }
- { \sys_if_engine_luatex_p: }
+\cs_if_exist:NF \tex_filesize:D
{
\cs_set_protected:Npn \@@_get_details:nnN #1#2#3
{
@@ -3095,33 +3055,12 @@
% \end{macro}
%
% \begin{macro}[EXP]{\@@_str_cmp:nn}
-% \begin{macro}[EXP]{\@@_str_escape:n}
% As we are doing a fixed-length \enquote{big} integer comparison, it
% is easiest to use the low-level behavior of string comparisons.
% \begin{macrocode}
-\cs_new:Npn \@@_str_cmp:nn #1#2 { \tex_strcmp:D {#1} {#2} }
-\sys_if_engine_luatex:T
- {
- \cs_set:Npn \@@_str_cmp:nn #1#2
- {
- \lua_now:e
- {
- l3kernel.strcmp
- (
- " \@@_str_escape:n {#1}",
- " \@@_str_escape:n {#2}"
- )
- }
- }
- \cs_new:Npn \@@_str_escape:n #1
- {
- \lua_escape:e
- { \__kernel_tl_to_str:w \use:e { {#1} } }
- }
- }
+\cs_new_eq:NN \@@_str_cmp:nn \tex_strcmp:D
% \end{macrocode}
% \end{macro}
-% \end{macro}
%
% \begin{macro}[EXP, pTF]{\file_compare_timestamp:nNn}
% \begin{macro}[EXP]{\@@_compare_timestamp:nnN}
@@ -3169,15 +3108,7 @@
}
}
}
-\sys_if_engine_luatex:TF
- {
- \cs_new:Npn \@@_timestamp:n #1
- {
- \lua_now:e
- { l3kernel.filemoddate ( " \lua_escape:e {#1} " ) }
- }
- }
- { \cs_new_eq:NN \@@_timestamp:n \tex_filemoddate:D }
+\cs_new_eq:NN \@@_timestamp:n \tex_filemoddate:D
\cs_if_exist:NF \@@_timestamp:n
{
\prg_set_conditional:Npnn \file_compare_timestamp:nNn #1#2#3