[latex3-commits] [git/LaTeX3-latex3-latex3] master: \pdffilesize does work with pseudo-files (0ac2bd58e)

Joseph Wright joseph.wright at morningstar2.co.uk
Wed Sep 4 13:50:53 CEST 2019


Repository : https://github.com/latex3/latex3
On branch  : master
Link       : https://github.com/latex3/latex3/commit/0ac2bd58edcc53febf34e5f936b573a51e7128dd

>---------------------------------------------------------------

commit 0ac2bd58edcc53febf34e5f936b573a51e7128dd
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date:   Wed Sep 4 12:50:53 2019 +0100

    \pdffilesize does work with pseudo-files
    
    What's important is that for a non-existent file


>---------------------------------------------------------------

0ac2bd58edcc53febf34e5f936b573a51e7128dd
 l3kernel/l3candidates.dtx               | 46 +++++++--------------------------
 l3kernel/l3file.dtx                     |  4 +--
 l3kernel/l3tl.dtx                       |  5 ++--
 l3kernel/testfiles/m3expl001.luatex.tlg |  5 +++-
 l3kernel/testfiles/m3expl001.ptex.tlg   |  5 +++-
 l3kernel/testfiles/m3expl001.tlg        |  5 +++-
 l3kernel/testfiles/m3expl001.uptex.tlg  |  5 +++-
 l3kernel/testfiles/m3expl001.xetex.tlg  |  5 +++-
 l3kernel/testfiles/m3expl003.luatex.tlg |  5 +++-
 l3kernel/testfiles/m3expl003.ptex.tlg   |  5 +++-
 l3kernel/testfiles/m3expl003.tlg        |  5 +++-
 l3kernel/testfiles/m3expl003.uptex.tlg  |  5 +++-
 l3kernel/testfiles/m3expl003.xetex.tlg  |  5 +++-
 13 files changed, 55 insertions(+), 50 deletions(-)

diff --git a/l3kernel/l3candidates.dtx b/l3kernel/l3candidates.dtx
index 060d49c9d..a73fb11ce 100644
--- a/l3kernel/l3candidates.dtx
+++ b/l3kernel/l3candidates.dtx
@@ -2230,21 +2230,11 @@
 % \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
 %   to probe further (see package \pkg{platform}), but that requires shell
-%   escape and seems unlikely to be useful. As the test here is not using
-%   real files, we have to use a \enquote{raw} approach to checking for
-%   \enquote{files}.
+%   escape and seems unlikely to be useful.
 %    \begin{macrocode}
 \sys_if_engine_luatex:TF
   {
@@ -2252,31 +2242,15 @@
       { \lua_now:n { tex.print(os.type) } }
   }
   {
-    \group_begin:
-      \prg_set_protected_conditional:Npnn \@@_if_exist:n #1
-        { T , F , TF }
-        {
-          \__kernel_ior_open:Nn \g_@@_internal_ior {#1}
-          \ior_if_eof:NTF \g_@@_internal_ior
-            {
-              \ior_close:N \g_@@_internal_ior
-              \prg_return_false:
-            }
-            {
-              \ior_close:N \g_@@_internal_ior 
-              \prg_return_true:
-            }
-        }
-      \@@_if_exist:nTF { nul: }
-        {
-          \@@_if_exist:nF { /dev/null }
-            { \str_const:Nn \c_sys_platform_str { windows } }
-        }
-        {
-          \@@_if_exist:nT { /dev/null }
-            { \str_const:Nn \c_sys_platform_str { unix } }
-        }
-    \group_end:
+    \file_if_exist:nTF { nul: }
+      {
+        \file_if_exist:nF { /dev/null }
+          { \str_const:Nn \c_sys_platform_str { windows } }
+      }
+      {
+        \file_if_exist:nT { /dev/null }
+          { \str_const:Nn \c_sys_platform_str { unix } }
+      }
   }
 \cs_if_exist:NF \c_sys_platform_str
   { \str_const:Nn \c_sys_platform_str { unknown }  }
diff --git a/l3kernel/l3file.dtx b/l3kernel/l3file.dtx
index 136bfdcbe..3e550c07a 100644
--- a/l3kernel/l3file.dtx
+++ b/l3kernel/l3file.dtx
@@ -2527,7 +2527,7 @@
   {
     \tl_if_blank:nF {#1}
       {
-        \int_compare:nNnTF { 0 \@@_file_size:n {#1} } = 0
+        \tl_if_blank:eTF { \@@_file_size:n {#1} }
           {
             \seq_map_tokens:Nn \l_file_search_path_seq
               { \@@_full_name_aux:nn {#2} }
@@ -2554,7 +2554,7 @@
   }
 \cs_new:Npn \@@_full_name_aux:n #1
   {
-    \int_compare:nNnF { 0 \@@_file_size:n {#1} } = 0
+    \tl_if_blank:eF { \@@_file_size:n {#1} }
       {
         \seq_map_break:n
           {
diff --git a/l3kernel/l3tl.dtx b/l3kernel/l3tl.dtx
index 12fe907ef..186b9d78f 100644
--- a/l3kernel/l3tl.dtx
+++ b/l3kernel/l3tl.dtx
@@ -353,7 +353,8 @@
 %
 % \section{Token list conditionals}
 %
-% \begin{function}[EXP,pTF]{\tl_if_blank:n, \tl_if_blank:V, \tl_if_blank:o}
+% \begin{function}[EXP,pTF, updated = 2019-09-04]
+%   {\tl_if_blank:n, \tl_if_blank:e, \tl_if_blank:V, \tl_if_blank:o}
 %   \begin{syntax}
 %     \cs{tl_if_blank_p:n} \Arg{token list}
 %     \cs{tl_if_blank:nTF} \Arg{token list} \Arg{true code} \Arg{false code}
@@ -2052,7 +2053,7 @@
     \fi:
   }
 \prg_generate_conditional_variant:Nnn \tl_if_blank:n
-  { V , o } { p , T , F , TF }
+  { e , V , o } { p , T , F , TF }
 %    \end{macrocode}
 % \end{macro}
 % \end{macro}
diff --git a/l3kernel/testfiles/m3expl001.luatex.tlg b/l3kernel/testfiles/m3expl001.luatex.tlg
index d97e7b989..f229c2cdf 100644
--- a/l3kernel/testfiles/m3expl001.luatex.tlg
+++ b/l3kernel/testfiles/m3expl001.luatex.tlg
@@ -429,12 +429,16 @@ Defining \tl_if_blank_p:n on line ...
 Defining \tl_if_blank:nT on line ...
 Defining \tl_if_blank:nF on line ...
 Defining \tl_if_blank:nTF on line ...
+Defining \tl_if_blank_p:e on line ...
 Defining \tl_if_blank_p:V on line ...
 Defining \tl_if_blank_p:o on line ...
+Defining \tl_if_blank:eT on line ...
 Defining \tl_if_blank:VT on line ...
 Defining \tl_if_blank:oT on line ...
+Defining \tl_if_blank:eF on line ...
 Defining \tl_if_blank:VF on line ...
 Defining \tl_if_blank:oF on line ...
+Defining \tl_if_blank:eTF on line ...
 Defining \tl_if_blank:VTF on line ...
 Defining \tl_if_blank:oTF on line ...
 Defining \tl_if_empty_p:N on line ...
@@ -6476,7 +6480,6 @@ 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 bada36835..a316d1da1 100644
--- a/l3kernel/testfiles/m3expl001.ptex.tlg
+++ b/l3kernel/testfiles/m3expl001.ptex.tlg
@@ -428,12 +428,16 @@ Defining \tl_if_blank_p:n on line ...
 Defining \tl_if_blank:nT on line ...
 Defining \tl_if_blank:nF on line ...
 Defining \tl_if_blank:nTF on line ...
+Defining \tl_if_blank_p:e on line ...
 Defining \tl_if_blank_p:V on line ...
 Defining \tl_if_blank_p:o on line ...
+Defining \tl_if_blank:eT on line ...
 Defining \tl_if_blank:VT on line ...
 Defining \tl_if_blank:oT on line ...
+Defining \tl_if_blank:eF on line ...
 Defining \tl_if_blank:VF on line ...
 Defining \tl_if_blank:oF on line ...
+Defining \tl_if_blank:eTF on line ...
 Defining \tl_if_blank:VTF on line ...
 Defining \tl_if_blank:oTF on line ...
 Defining \tl_if_empty_p:N on line ...
@@ -6471,7 +6475,6 @@ 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 2637ac4c2..b5d0377be 100644
--- a/l3kernel/testfiles/m3expl001.tlg
+++ b/l3kernel/testfiles/m3expl001.tlg
@@ -428,12 +428,16 @@ Defining \tl_if_blank_p:n on line ...
 Defining \tl_if_blank:nT on line ...
 Defining \tl_if_blank:nF on line ...
 Defining \tl_if_blank:nTF on line ...
+Defining \tl_if_blank_p:e on line ...
 Defining \tl_if_blank_p:V on line ...
 Defining \tl_if_blank_p:o on line ...
+Defining \tl_if_blank:eT on line ...
 Defining \tl_if_blank:VT on line ...
 Defining \tl_if_blank:oT on line ...
+Defining \tl_if_blank:eF on line ...
 Defining \tl_if_blank:VF on line ...
 Defining \tl_if_blank:oF on line ...
+Defining \tl_if_blank:eTF on line ...
 Defining \tl_if_blank:VTF on line ...
 Defining \tl_if_blank:oTF on line ...
 Defining \tl_if_empty_p:N on line ...
@@ -6471,7 +6475,6 @@ 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 31a49365c..d782ad5f2 100644
--- a/l3kernel/testfiles/m3expl001.uptex.tlg
+++ b/l3kernel/testfiles/m3expl001.uptex.tlg
@@ -428,12 +428,16 @@ Defining \tl_if_blank_p:n on line ...
 Defining \tl_if_blank:nT on line ...
 Defining \tl_if_blank:nF on line ...
 Defining \tl_if_blank:nTF on line ...
+Defining \tl_if_blank_p:e on line ...
 Defining \tl_if_blank_p:V on line ...
 Defining \tl_if_blank_p:o on line ...
+Defining \tl_if_blank:eT on line ...
 Defining \tl_if_blank:VT on line ...
 Defining \tl_if_blank:oT on line ...
+Defining \tl_if_blank:eF on line ...
 Defining \tl_if_blank:VF on line ...
 Defining \tl_if_blank:oF on line ...
+Defining \tl_if_blank:eTF on line ...
 Defining \tl_if_blank:VTF on line ...
 Defining \tl_if_blank:oTF on line ...
 Defining \tl_if_empty_p:N on line ...
@@ -6467,7 +6471,6 @@ 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 cda998889..dc8a32666 100644
--- a/l3kernel/testfiles/m3expl001.xetex.tlg
+++ b/l3kernel/testfiles/m3expl001.xetex.tlg
@@ -428,12 +428,16 @@ Defining \tl_if_blank_p:n on line ...
 Defining \tl_if_blank:nT on line ...
 Defining \tl_if_blank:nF on line ...
 Defining \tl_if_blank:nTF on line ...
+Defining \tl_if_blank_p:e on line ...
 Defining \tl_if_blank_p:V on line ...
 Defining \tl_if_blank_p:o on line ...
+Defining \tl_if_blank:eT on line ...
 Defining \tl_if_blank:VT on line ...
 Defining \tl_if_blank:oT on line ...
+Defining \tl_if_blank:eF on line ...
 Defining \tl_if_blank:VF on line ...
 Defining \tl_if_blank:oF on line ...
+Defining \tl_if_blank:eTF on line ...
 Defining \tl_if_blank:VTF on line ...
 Defining \tl_if_blank:oTF on line ...
 Defining \tl_if_empty_p:N on line ...
@@ -6475,7 +6479,6 @@ 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 d97e7b989..f229c2cdf 100644
--- a/l3kernel/testfiles/m3expl003.luatex.tlg
+++ b/l3kernel/testfiles/m3expl003.luatex.tlg
@@ -429,12 +429,16 @@ Defining \tl_if_blank_p:n on line ...
 Defining \tl_if_blank:nT on line ...
 Defining \tl_if_blank:nF on line ...
 Defining \tl_if_blank:nTF on line ...
+Defining \tl_if_blank_p:e on line ...
 Defining \tl_if_blank_p:V on line ...
 Defining \tl_if_blank_p:o on line ...
+Defining \tl_if_blank:eT on line ...
 Defining \tl_if_blank:VT on line ...
 Defining \tl_if_blank:oT on line ...
+Defining \tl_if_blank:eF on line ...
 Defining \tl_if_blank:VF on line ...
 Defining \tl_if_blank:oF on line ...
+Defining \tl_if_blank:eTF on line ...
 Defining \tl_if_blank:VTF on line ...
 Defining \tl_if_blank:oTF on line ...
 Defining \tl_if_empty_p:N on line ...
@@ -6476,7 +6480,6 @@ 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 bada36835..a316d1da1 100644
--- a/l3kernel/testfiles/m3expl003.ptex.tlg
+++ b/l3kernel/testfiles/m3expl003.ptex.tlg
@@ -428,12 +428,16 @@ Defining \tl_if_blank_p:n on line ...
 Defining \tl_if_blank:nT on line ...
 Defining \tl_if_blank:nF on line ...
 Defining \tl_if_blank:nTF on line ...
+Defining \tl_if_blank_p:e on line ...
 Defining \tl_if_blank_p:V on line ...
 Defining \tl_if_blank_p:o on line ...
+Defining \tl_if_blank:eT on line ...
 Defining \tl_if_blank:VT on line ...
 Defining \tl_if_blank:oT on line ...
+Defining \tl_if_blank:eF on line ...
 Defining \tl_if_blank:VF on line ...
 Defining \tl_if_blank:oF on line ...
+Defining \tl_if_blank:eTF on line ...
 Defining \tl_if_blank:VTF on line ...
 Defining \tl_if_blank:oTF on line ...
 Defining \tl_if_empty_p:N on line ...
@@ -6471,7 +6475,6 @@ 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 2637ac4c2..b5d0377be 100644
--- a/l3kernel/testfiles/m3expl003.tlg
+++ b/l3kernel/testfiles/m3expl003.tlg
@@ -428,12 +428,16 @@ Defining \tl_if_blank_p:n on line ...
 Defining \tl_if_blank:nT on line ...
 Defining \tl_if_blank:nF on line ...
 Defining \tl_if_blank:nTF on line ...
+Defining \tl_if_blank_p:e on line ...
 Defining \tl_if_blank_p:V on line ...
 Defining \tl_if_blank_p:o on line ...
+Defining \tl_if_blank:eT on line ...
 Defining \tl_if_blank:VT on line ...
 Defining \tl_if_blank:oT on line ...
+Defining \tl_if_blank:eF on line ...
 Defining \tl_if_blank:VF on line ...
 Defining \tl_if_blank:oF on line ...
+Defining \tl_if_blank:eTF on line ...
 Defining \tl_if_blank:VTF on line ...
 Defining \tl_if_blank:oTF on line ...
 Defining \tl_if_empty_p:N on line ...
@@ -6471,7 +6475,6 @@ 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 31a49365c..d782ad5f2 100644
--- a/l3kernel/testfiles/m3expl003.uptex.tlg
+++ b/l3kernel/testfiles/m3expl003.uptex.tlg
@@ -428,12 +428,16 @@ Defining \tl_if_blank_p:n on line ...
 Defining \tl_if_blank:nT on line ...
 Defining \tl_if_blank:nF on line ...
 Defining \tl_if_blank:nTF on line ...
+Defining \tl_if_blank_p:e on line ...
 Defining \tl_if_blank_p:V on line ...
 Defining \tl_if_blank_p:o on line ...
+Defining \tl_if_blank:eT on line ...
 Defining \tl_if_blank:VT on line ...
 Defining \tl_if_blank:oT on line ...
+Defining \tl_if_blank:eF on line ...
 Defining \tl_if_blank:VF on line ...
 Defining \tl_if_blank:oF on line ...
+Defining \tl_if_blank:eTF on line ...
 Defining \tl_if_blank:VTF on line ...
 Defining \tl_if_blank:oTF on line ...
 Defining \tl_if_empty_p:N on line ...
@@ -6467,7 +6471,6 @@ 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 cda998889..dc8a32666 100644
--- a/l3kernel/testfiles/m3expl003.xetex.tlg
+++ b/l3kernel/testfiles/m3expl003.xetex.tlg
@@ -428,12 +428,16 @@ Defining \tl_if_blank_p:n on line ...
 Defining \tl_if_blank:nT on line ...
 Defining \tl_if_blank:nF on line ...
 Defining \tl_if_blank:nTF on line ...
+Defining \tl_if_blank_p:e on line ...
 Defining \tl_if_blank_p:V on line ...
 Defining \tl_if_blank_p:o on line ...
+Defining \tl_if_blank:eT on line ...
 Defining \tl_if_blank:VT on line ...
 Defining \tl_if_blank:oT on line ...
+Defining \tl_if_blank:eF on line ...
 Defining \tl_if_blank:VF on line ...
 Defining \tl_if_blank:oF on line ...
+Defining \tl_if_blank:eTF on line ...
 Defining \tl_if_blank:VTF on line ...
 Defining \tl_if_blank:oTF on line ...
 Defining \tl_if_empty_p:N on line ...
@@ -6475,7 +6479,6 @@ 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