[latex3-commits] [git/LaTeX3-latex3-latex3] master: Handle file/sys stream correctly (bedc7231d)
Joseph Wright
joseph.wright at morningstar2.co.uk
Wed Sep 4 12:13:32 CEST 2019
Repository : https://github.com/latex3/latex3
On branch : master
Link : https://github.com/latex3/latex3/commit/bedc7231d421ddfc525a99892aad53aac3478c39
>---------------------------------------------------------------
commit bedc7231d421ddfc525a99892aad53aac3478c39
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date: Wed Sep 4 11:13:32 2019 +0100
Handle file/sys stream correctly
This doesn't actually cost a stream, only a csname,
so there is no real 'hit' in doing things the official way.
>---------------------------------------------------------------
bedc7231d421ddfc525a99892aad53aac3478c39
l3kernel/l3candidates.dtx | 9 ++++++++-
l3kernel/l3file.dtx | 16 +++++++++-------
l3kernel/testfiles/m3expl001.luatex.tlg | 2 +-
l3kernel/testfiles/m3expl001.ptex.tlg | 2 +-
l3kernel/testfiles/m3expl001.tlg | 2 +-
l3kernel/testfiles/m3expl001.uptex.tlg | 2 +-
l3kernel/testfiles/m3expl001.xetex.tlg | 2 +-
l3kernel/testfiles/m3expl003.luatex.tlg | 2 +-
l3kernel/testfiles/m3expl003.ptex.tlg | 2 +-
l3kernel/testfiles/m3expl003.tlg | 2 +-
l3kernel/testfiles/m3expl003.uptex.tlg | 2 +-
l3kernel/testfiles/m3expl003.xetex.tlg | 2 +-
12 files changed, 27 insertions(+), 18 deletions(-)
diff --git a/l3kernel/l3candidates.dtx b/l3kernel/l3candidates.dtx
index 00bd76091..060d49c9d 100644
--- a/l3kernel/l3candidates.dtx
+++ b/l3kernel/l3candidates.dtx
@@ -2230,6 +2230,14 @@
% \end{macro}
% \end{macro}
%
+% \begin{variable}{\g_@@_internal_ior}
+% As noted below, we need a stream for checking for pseudo-files; to
+% avoid engine variation, it is always created.
+% \begin{macrocode}
+\ior_new:N \g_@@_internal_ior
+% \end{macrocode}
+% \end{variable}
+%
% \begin{variable}{\c_sys_platform_str}
% Detecting the platform on \LuaTeX{} is easy: for other engines, we use
% the fact that the two common cases have special null files. It is possible
@@ -2245,7 +2253,6 @@
}
{
\group_begin:
- \cs_set_eq:Nc \g_@@_internal_ior { g_ _file_internal_ior }
\prg_set_protected_conditional:Npnn \@@_if_exist:n #1
{ T , F , TF }
{
diff --git a/l3kernel/l3file.dtx b/l3kernel/l3file.dtx
index e06602ccd..136bfdcbe 100644
--- a/l3kernel/l3file.dtx
+++ b/l3kernel/l3file.dtx
@@ -2189,13 +2189,6 @@
% \end{macrocode}
% \end{variable}
%
-% \begin{variable}{\g_@@_internal_ior}
-% A reserved stream to test for file existence.
-% \begin{macrocode}
-\ior_new:N \g_@@_internal_ior
-% \end{macrocode}
-% \end{variable}
-%
% \begin{variable}
% {
% \g_file_curr_dir_str ,
@@ -2714,6 +2707,15 @@
% \end{macro}
% \end{macro}
% \end{macro}
+% \begin{variable}{\g_@@_internal_ior}
+% A reserved stream to test for file existence, if required.
+% \begin{macrocode}
+\bool_lazy_or:nnF
+ { \cs_if_exist_p:N \tex_filesize:D }
+ { \sys_if_engine_luatex_p: }
+ { \ior_new:N \g_@@_internal_ior }
+% \end{macrocode}
+% \end{variable}
%
% \begin{macro}[rEXP]{\file_mdfive_hash:n, \file_size:n, \file_timestamp:n}
% \begin{macro}[rEXP]{\@@_details:nn, \@@_details_aux:nn}
diff --git a/l3kernel/testfiles/m3expl001.luatex.tlg b/l3kernel/testfiles/m3expl001.luatex.tlg
index c49d0e3c5..d97e7b989 100644
--- a/l3kernel/testfiles/m3expl001.luatex.tlg
+++ b/l3kernel/testfiles/m3expl001.luatex.tlg
@@ -2886,7 +2886,6 @@ Defining \__iow_wrap_trim:N on line ...
Defining \__iow_wrap_trim:w on line ...
Defining \__iow_wrap_trim_aux:w on line ...
Defining \l__file_internal_tl on line ...
-Defining \g__file_internal_ior on line ...
Defining \g_file_curr_dir_str on line ...
Defining \g_file_curr_ext_str on line ...
Defining \g_file_curr_name_str on line ...
@@ -6477,6 +6476,7 @@ Defining \sys_shell_get:nnNTF on line ...
Defining \__sys_get:nnN on line ...
Defining \__sys_get_do:Nw on line ...
Defining message LaTeX/kernel/quote-in-shell on line ...
+Defining \g__sys_internal_ior on line ...
Defining \c_sys_platform_str on line ...
Defining \sys_if_platform_unix:T on line ...
Defining \sys_if_platform_unix:F on line ...
diff --git a/l3kernel/testfiles/m3expl001.ptex.tlg b/l3kernel/testfiles/m3expl001.ptex.tlg
index 2a3524ac5..bada36835 100644
--- a/l3kernel/testfiles/m3expl001.ptex.tlg
+++ b/l3kernel/testfiles/m3expl001.ptex.tlg
@@ -3140,7 +3140,6 @@ Defining \__iow_wrap_trim:N on line ...
Defining \__iow_wrap_trim:w on line ...
Defining \__iow_wrap_trim_aux:w on line ...
Defining \l__file_internal_tl on line ...
-Defining \g__file_internal_ior on line ...
Defining \g_file_curr_dir_str on line ...
Defining \g_file_curr_ext_str on line ...
Defining \g_file_curr_name_str on line ...
@@ -6472,6 +6471,7 @@ Defining \sys_shell_get:nnNTF on line ...
Defining \__sys_get:nnN on line ...
Defining \__sys_get_do:Nw on line ...
Defining message LaTeX/kernel/quote-in-shell on line ...
+Defining \g__sys_internal_ior on line ...
Defining \c_sys_platform_str on line ...
Defining \sys_if_platform_unix:T on line ...
Defining \sys_if_platform_unix:F on line ...
diff --git a/l3kernel/testfiles/m3expl001.tlg b/l3kernel/testfiles/m3expl001.tlg
index 66d10164e..2637ac4c2 100644
--- a/l3kernel/testfiles/m3expl001.tlg
+++ b/l3kernel/testfiles/m3expl001.tlg
@@ -3140,7 +3140,6 @@ Defining \__iow_wrap_trim:N on line ...
Defining \__iow_wrap_trim:w on line ...
Defining \__iow_wrap_trim_aux:w on line ...
Defining \l__file_internal_tl on line ...
-Defining \g__file_internal_ior on line ...
Defining \g_file_curr_dir_str on line ...
Defining \g_file_curr_ext_str on line ...
Defining \g_file_curr_name_str on line ...
@@ -6472,6 +6471,7 @@ Defining \sys_shell_get:nnNTF on line ...
Defining \__sys_get:nnN on line ...
Defining \__sys_get_do:Nw on line ...
Defining message LaTeX/kernel/quote-in-shell on line ...
+Defining \g__sys_internal_ior on line ...
Defining \c_sys_platform_str on line ...
Defining \sys_if_platform_unix:T on line ...
Defining \sys_if_platform_unix:F on line ...
diff --git a/l3kernel/testfiles/m3expl001.uptex.tlg b/l3kernel/testfiles/m3expl001.uptex.tlg
index 65d325f1e..31a49365c 100644
--- a/l3kernel/testfiles/m3expl001.uptex.tlg
+++ b/l3kernel/testfiles/m3expl001.uptex.tlg
@@ -3140,7 +3140,6 @@ Defining \__iow_wrap_trim:N on line ...
Defining \__iow_wrap_trim:w on line ...
Defining \__iow_wrap_trim_aux:w on line ...
Defining \l__file_internal_tl on line ...
-Defining \g__file_internal_ior on line ...
Defining \g_file_curr_dir_str on line ...
Defining \g_file_curr_ext_str on line ...
Defining \g_file_curr_name_str on line ...
@@ -6468,6 +6467,7 @@ Defining \sys_shell_get:nnNTF on line ...
Defining \__sys_get:nnN on line ...
Defining \__sys_get_do:Nw on line ...
Defining message LaTeX/kernel/quote-in-shell on line ...
+Defining \g__sys_internal_ior on line ...
Defining \c_sys_platform_str on line ...
Defining \sys_if_platform_unix:T on line ...
Defining \sys_if_platform_unix:F on line ...
diff --git a/l3kernel/testfiles/m3expl001.xetex.tlg b/l3kernel/testfiles/m3expl001.xetex.tlg
index 3afc65b21..cda998889 100644
--- a/l3kernel/testfiles/m3expl001.xetex.tlg
+++ b/l3kernel/testfiles/m3expl001.xetex.tlg
@@ -2884,7 +2884,6 @@ Defining \__iow_wrap_trim:N on line ...
Defining \__iow_wrap_trim:w on line ...
Defining \__iow_wrap_trim_aux:w on line ...
Defining \l__file_internal_tl on line ...
-Defining \g__file_internal_ior on line ...
Defining \g_file_curr_dir_str on line ...
Defining \g_file_curr_ext_str on line ...
Defining \g_file_curr_name_str on line ...
@@ -6476,6 +6475,7 @@ Defining \sys_shell_get:nnNTF on line ...
Defining \__sys_get:nnN on line ...
Defining \__sys_get_do:Nw on line ...
Defining message LaTeX/kernel/quote-in-shell on line ...
+Defining \g__sys_internal_ior on line ...
Defining \c_sys_platform_str on line ...
Defining \sys_if_platform_unix:T on line ...
Defining \sys_if_platform_unix:F on line ...
diff --git a/l3kernel/testfiles/m3expl003.luatex.tlg b/l3kernel/testfiles/m3expl003.luatex.tlg
index c49d0e3c5..d97e7b989 100644
--- a/l3kernel/testfiles/m3expl003.luatex.tlg
+++ b/l3kernel/testfiles/m3expl003.luatex.tlg
@@ -2886,7 +2886,6 @@ Defining \__iow_wrap_trim:N on line ...
Defining \__iow_wrap_trim:w on line ...
Defining \__iow_wrap_trim_aux:w on line ...
Defining \l__file_internal_tl on line ...
-Defining \g__file_internal_ior on line ...
Defining \g_file_curr_dir_str on line ...
Defining \g_file_curr_ext_str on line ...
Defining \g_file_curr_name_str on line ...
@@ -6477,6 +6476,7 @@ Defining \sys_shell_get:nnNTF on line ...
Defining \__sys_get:nnN on line ...
Defining \__sys_get_do:Nw on line ...
Defining message LaTeX/kernel/quote-in-shell on line ...
+Defining \g__sys_internal_ior on line ...
Defining \c_sys_platform_str on line ...
Defining \sys_if_platform_unix:T on line ...
Defining \sys_if_platform_unix:F on line ...
diff --git a/l3kernel/testfiles/m3expl003.ptex.tlg b/l3kernel/testfiles/m3expl003.ptex.tlg
index 2a3524ac5..bada36835 100644
--- a/l3kernel/testfiles/m3expl003.ptex.tlg
+++ b/l3kernel/testfiles/m3expl003.ptex.tlg
@@ -3140,7 +3140,6 @@ Defining \__iow_wrap_trim:N on line ...
Defining \__iow_wrap_trim:w on line ...
Defining \__iow_wrap_trim_aux:w on line ...
Defining \l__file_internal_tl on line ...
-Defining \g__file_internal_ior on line ...
Defining \g_file_curr_dir_str on line ...
Defining \g_file_curr_ext_str on line ...
Defining \g_file_curr_name_str on line ...
@@ -6472,6 +6471,7 @@ Defining \sys_shell_get:nnNTF on line ...
Defining \__sys_get:nnN on line ...
Defining \__sys_get_do:Nw on line ...
Defining message LaTeX/kernel/quote-in-shell on line ...
+Defining \g__sys_internal_ior on line ...
Defining \c_sys_platform_str on line ...
Defining \sys_if_platform_unix:T on line ...
Defining \sys_if_platform_unix:F on line ...
diff --git a/l3kernel/testfiles/m3expl003.tlg b/l3kernel/testfiles/m3expl003.tlg
index 66d10164e..2637ac4c2 100644
--- a/l3kernel/testfiles/m3expl003.tlg
+++ b/l3kernel/testfiles/m3expl003.tlg
@@ -3140,7 +3140,6 @@ Defining \__iow_wrap_trim:N on line ...
Defining \__iow_wrap_trim:w on line ...
Defining \__iow_wrap_trim_aux:w on line ...
Defining \l__file_internal_tl on line ...
-Defining \g__file_internal_ior on line ...
Defining \g_file_curr_dir_str on line ...
Defining \g_file_curr_ext_str on line ...
Defining \g_file_curr_name_str on line ...
@@ -6472,6 +6471,7 @@ Defining \sys_shell_get:nnNTF on line ...
Defining \__sys_get:nnN on line ...
Defining \__sys_get_do:Nw on line ...
Defining message LaTeX/kernel/quote-in-shell on line ...
+Defining \g__sys_internal_ior on line ...
Defining \c_sys_platform_str on line ...
Defining \sys_if_platform_unix:T on line ...
Defining \sys_if_platform_unix:F on line ...
diff --git a/l3kernel/testfiles/m3expl003.uptex.tlg b/l3kernel/testfiles/m3expl003.uptex.tlg
index 65d325f1e..31a49365c 100644
--- a/l3kernel/testfiles/m3expl003.uptex.tlg
+++ b/l3kernel/testfiles/m3expl003.uptex.tlg
@@ -3140,7 +3140,6 @@ Defining \__iow_wrap_trim:N on line ...
Defining \__iow_wrap_trim:w on line ...
Defining \__iow_wrap_trim_aux:w on line ...
Defining \l__file_internal_tl on line ...
-Defining \g__file_internal_ior on line ...
Defining \g_file_curr_dir_str on line ...
Defining \g_file_curr_ext_str on line ...
Defining \g_file_curr_name_str on line ...
@@ -6468,6 +6467,7 @@ Defining \sys_shell_get:nnNTF on line ...
Defining \__sys_get:nnN on line ...
Defining \__sys_get_do:Nw on line ...
Defining message LaTeX/kernel/quote-in-shell on line ...
+Defining \g__sys_internal_ior on line ...
Defining \c_sys_platform_str on line ...
Defining \sys_if_platform_unix:T on line ...
Defining \sys_if_platform_unix:F on line ...
diff --git a/l3kernel/testfiles/m3expl003.xetex.tlg b/l3kernel/testfiles/m3expl003.xetex.tlg
index 3afc65b21..cda998889 100644
--- a/l3kernel/testfiles/m3expl003.xetex.tlg
+++ b/l3kernel/testfiles/m3expl003.xetex.tlg
@@ -2884,7 +2884,6 @@ Defining \__iow_wrap_trim:N on line ...
Defining \__iow_wrap_trim:w on line ...
Defining \__iow_wrap_trim_aux:w on line ...
Defining \l__file_internal_tl on line ...
-Defining \g__file_internal_ior on line ...
Defining \g_file_curr_dir_str on line ...
Defining \g_file_curr_ext_str on line ...
Defining \g_file_curr_name_str on line ...
@@ -6476,6 +6475,7 @@ Defining \sys_shell_get:nnNTF on line ...
Defining \__sys_get:nnN on line ...
Defining \__sys_get_do:Nw on line ...
Defining message LaTeX/kernel/quote-in-shell on line ...
+Defining \g__sys_internal_ior on line ...
Defining \c_sys_platform_str on line ...
Defining \sys_if_platform_unix:T on line ...
Defining \sys_if_platform_unix:F on line ...
More information about the latex3-commits
mailing list