[latex3-commits] [l3svn] branch master updated: Overhaul l3file functions

noreply at latex-project.org noreply at latex-project.org
Mon Jun 19 23:33:28 CEST 2017


This is an automated email from the git hooks/post-receive script.

joseph pushed a commit to branch master
in repository l3svn.

The following commit(s) were added to refs/heads/master by this push:
       new  bf52c87   Overhaul l3file functions
bf52c87 is described below

commit bf52c87f72ba11c4309fb001321d708dda828239
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date:   Mon Jun 19 16:33:59 2017 +0100

    Overhaul l3file functions
    
    This update covers several tweaks/improvements
    - Use str rather than tl vars where appropriate
    - Expose path seq to allow e.g. \graphicspath-like swapping of the
      paths
    - Correctly quote *paths* as well as *names* containing spaces
    - Better internal data transfer approaches
    
    Building on this will be subsequent improvements to data returned
    by l3file.
---
 l3kernel/l3candidates.dtx               |   26 ++-
 l3kernel/l3doc.dtx                      |    2 +-
 l3kernel/l3file.dtx                     |  379 +++++++++++++++++--------------
 l3kernel/l3msg.dtx                      |    2 +-
 l3kernel/l3obsolete.txt                 |    4 +
 l3kernel/testfiles/m3expl001.luatex.tlg |   40 ++--
 l3kernel/testfiles/m3expl001.ptex.tlg   |   40 ++--
 l3kernel/testfiles/m3expl001.tlg        |   40 ++--
 l3kernel/testfiles/m3expl001.uptex.tlg  |   40 ++--
 l3kernel/testfiles/m3expl001.xetex.tlg  |   40 ++--
 l3kernel/testfiles/m3expl003.luatex.tlg |   40 ++--
 l3kernel/testfiles/m3expl003.ptex.tlg   |   40 ++--
 l3kernel/testfiles/m3expl003.tlg        |   40 ++--
 l3kernel/testfiles/m3expl003.uptex.tlg  |   40 ++--
 l3kernel/testfiles/m3expl003.xetex.tlg  |   40 ++--
 l3kernel/testfiles/m3file001.lvt        |   26 ++-
 l3kernel/testfiles/m3file001.ptex.tlg   |   28 ++-
 l3kernel/testfiles/m3file001.tlg        |   28 ++-
 l3kernel/testfiles/m3file001.uptex.tlg  |   28 ++-
 l3kernel/testfiles/m3file001.xetex.tlg  |   28 ++-
 20 files changed, 539 insertions(+), 412 deletions(-)

diff --git a/l3kernel/l3candidates.dtx b/l3kernel/l3candidates.dtx
index aeb2ce1..faf809a 100644
--- a/l3kernel/l3candidates.dtx
+++ b/l3kernel/l3candidates.dtx
@@ -1469,28 +1469,28 @@
 %    \begin{macrocode}
 \cs_new_protected:Npn \file_if_exist_input:n #1
   {
-    \file_if_exist:nT {#1}
-      { \@@_input:V \l_@@_internal_name_tl }
+    \file_if_exist:nNT {#1} \l__file_path_str
+      { \@@_input:V \l__file_path_str }
   }
 \cs_new_protected:Npn \file_if_exist_input:nT #1#2
   {
-    \file_if_exist:nT {#1}
+    \file_if_exist:nNT {#1} \l__file_path_str
       {
         #2
-        \@@_input:V \l_@@_internal_name_tl
+        \@@_input:V \l__file_path_str
       }
   }
 \cs_new_protected:Npn \file_if_exist_input:nF #1
   {
-    \file_if_exist:nTF {#1}
-      { \@@_input:V \l_@@_internal_name_tl }
+    \file_if_exist:nNTF {#1} \l__file_path_str
+      { \@@_input:V \l__file_path_str }
   }
 \cs_new_protected:Npn \file_if_exist_input:nTF #1#2
   {
-    \file_if_exist:nTF {#1}
+    \file_if_exist:nNTF {#1} \l__file_path_str
       {
         #2
-        \@@_input:V \l_@@_internal_name_tl
+        \@@_input:V \l__file_path_str
       }
   }
 %    \end{macrocode}
@@ -2162,7 +2162,7 @@
 \cs_generate_variant:Nn \tl_gset_from_file:Nnn { c }
 \cs_new_protected:Npn \@@_set_from_file:NNnn #1#2#3#4
   {
-    \__file_if_exist:nT {#4}
+    \file_if_exist:nNTF {#4} \l__file_path_str
       {
         \group_begin:
           \exp_args:No \etex_everyeof:D
@@ -2170,10 +2170,11 @@
           #3 \scan_stop:
           \exp_after:wN \@@_from_file_do:w
           \exp_after:wN \prg_do_nothing:
-            \tex_input:D \l__file_internal_name_tl \scan_stop:
+            \tex_input:D \l__file_path_str \scan_stop:
         \exp_args:NNNo \group_end:
         #1 #2 \l_@@_internal_a_tl
       }
+      { \__file_missing:n {#4} }
   }
 \exp_args:Nno \use:nn
   { \cs_new_protected:Npn \@@_from_file_do:w #1 }
@@ -2204,16 +2205,17 @@
 \cs_generate_variant:Nn \tl_gset_from_file_x:Nnn { c }
 \cs_new_protected:Npn \@@_set_from_file_x:NNnn #1#2#3#4
   {
-    \__file_if_exist:nT {#4}
+    \file_if_exist:nNTF {#4} \l__file_path_str
       {
         \group_begin:
           \etex_everyeof:D { \exp_not:N }
           #3 \scan_stop:
           \tl_set:Nx \l_@@_internal_a_tl
-            { \tex_input:D \l__file_internal_name_tl \c_space_token }
+            { \tex_input:D \l__file_path_str \c_space_token }
         \exp_args:NNNo \group_end:
         #1 #2 \l_@@_internal_a_tl
       }
+      { \__file_missing:n {#4} }
   }
 %    \end{macrocode}
 % \end{macro}
diff --git a/l3kernel/l3doc.dtx b/l3kernel/l3doc.dtx
index 489a6a6..d748bf4 100644
--- a/l3kernel/l3doc.dtx
+++ b/l3kernel/l3doc.dtx
@@ -2929,7 +2929,7 @@ and all files in that bundle must be distributed together.
     \@@_test_missing_aux:Nxn
       \g_@@_missing_tests_prop
       { \seq_use:Nn \l_@@_names_seq { , } }
-      { { \g_file_current_name_tl \iow_char:N \ (#1) } }
+      { { \g_file_current_name_str \iow_char:N \ (#1) } }
   }
 \cs_new_protected:Npn \@@_test_missing_aux:Nnn #1#2#3
   {
diff --git a/l3kernel/l3file.dtx b/l3kernel/l3file.dtx
index a3ceb04..487c355 100644
--- a/l3kernel/l3file.dtx
+++ b/l3kernel/l3file.dtx
@@ -68,7 +68,7 @@
 %
 % \section{File operation functions}
 %
-% \begin{variable}{\g_file_current_name_tl}
+% \begin{variable}[added = 2017-06-18]{\g_file_current_name_str}
 %   Contains the name of the current \LaTeX{} file. This variable
 %   should not be modified: it is intended for information only. It
 %   will be equal to \cs{c_sys_jobname_str} at the start of a \LaTeX{}
@@ -76,24 +76,40 @@
 %   \cs{file_input:n}.
 % \end{variable}
 %
+% \begin{variable}[added = 2017-06-18]{\l_file_search_path_seq}
+%   Each entry is a (relative) directory which should be searched when
+%   seeking a file. The entries will not be expanded when used so
+%   may contain active characters but should not feature any variable
+%   content.
+% \end{variable}
+%
 % \begin{function}[TF, updated = 2012-02-10]{\file_if_exist:n}
 %   \begin{syntax}
 %     \cs{file_if_exist:nTF} \Arg{file name} \Arg{true code} \Arg{false code}
 %   \end{syntax}
 %   Searches for \meta{file name} using the current \TeX{} search
 %   path and the additional paths controlled by
-%   \cs{file_path_include:n}).
+%   \cs{l_file_seach_path_seq}).
 % \end{function}
 %
-% \begin{function}[updated = 2012-02-10]{\file_add_path:nN}
+% \begin{function}[TF, added = 2017-06-19]{\file_if_exist:nN}
 %   \begin{syntax}
-%     \cs{file_add_path:nN} \Arg{file name} \meta{tl var}
+%     \cs{file_if_exist:nTF} \Arg{file name} \meta{str var} \Arg{true code} \Arg{false code}
+%   \end{syntax}
+%   Searches for \meta{file name} using the current \TeX{} search
+%   path and the additional paths controlled by
+%   \cs{l_file_seach_path_seq}). The resulting full path is returned as
+%   \meta{str var}, which will be empty if the file is not found.
+% \end{function}
+%
+% \begin{function}[updated = 2017-06-19]{\file_find:nN, \file_find:VN}
+%   \begin{syntax}
+%     \cs{file_find:nN} \Arg{file name} \meta{str var}
 %   \end{syntax}
 %   Searches for \meta{file name} in the path as detailed for
-%   \cs{file_if_exist:nTF}, and if found sets the \meta{tl var} the
+%   \cs{file_if_exist:nTF}, and if found sets the \meta{str var} the
 %   fully-qualified name of the file, \emph{i.e.}~the path and file name.
-%   If the file is not found then the \meta{tl var} will contain the
-%   marker \cs{q_no_value}.
+%   If the file is not found then the \meta{str var} will be empty.
 % \end{function}
 %
 % \begin{function}[updated = 2012-02-17]{\file_input:n}
@@ -107,28 +123,6 @@
 %   function. An error will be raised if the file is not found.
 % \end{function}
 %
-% \begin{function}[updated = 2012-07-04]{\file_path_include:n}
-%   \begin{syntax}
-%     \cs{file_path_include:n} \Arg{path}
-%   \end{syntax}
-%   Adds \meta{path} to the list of those used to search when reading
-%   files. The assignment is local.
-%   The \meta{path} is processed in the same way as a \meta{file name},
-%   \emph{i.e.}, with \texttt{x}-type expansion except active
-%   characters.
-% \end{function}
-%
-% \begin{function}[updated = 2012-07-04]{\file_path_remove:n}
-%   \begin{syntax}
-%     \cs{file_path_remove:n} \Arg{path}
-%   \end{syntax}
-%   Removes \meta{path} from the list of those used to search when reading
-%   files. The assignment is local.
-%   The \meta{path} is processed in the same way as a \meta{file name},
-%   \emph{i.e.}, with \texttt{x}-type expansion except active
-%   characters.
-% \end{function}
-%
 % \begin{function}{\file_list:}
 %   \begin{syntax}
 %     \cs{file_list:}
@@ -593,6 +587,11 @@
 %   Used to test for the existence of files when opening.
 % \end{variable}
 %
+% \begin{variable}{\l__file_name_str, \l__file_path_str}
+%   Used to store and transfer the file name and (partial) file path
+%   whilst reading files.
+% \end{variable}
+%
 % \begin{variable}{\l__file_internal_name_tl}
 %   Used to return the full name of a file for internal use. This is
 %   set by \cs{file_if_exist:nTF} and \cs{__file_if_exist:nT}, and
@@ -600,16 +599,24 @@
 %   further operations intervene.
 % \end{variable}
 %
-% \begin{function}[added = 2012-02-09]{\__file_name_sanitize:nn}
+% \begin{function}[added = 2017-06-19]{\__file_name_sanitize:nN}
 %   \begin{syntax}
-%     \cs{__file_name_sanitize:nn} \Arg{name} \Arg{tokens}
+%     \cs{__file_name_sanitize:nn} \Arg{name} \Arg{str var}
 %   \end{syntax}
 %   Exhaustively-expands the \meta{name} with the exception of any
 %   category \meta{active} (catcode~$13$) tokens, which are not expanded.
 %   The list of \meta{active} tokens is taken from \cs{l_char_active_seq}.
-%   The \meta{sanitized name} is then inserted (in braces) after the
-%   \meta{tokens}, which should further process the file name. If any
-%   spaces are found in the name after expansion, an error is raised.
+%   The \meta{str var} is then set to the \meta{sanitized name}.
+% \end{function}
+%
+% \begin{function}[added = 2017-06-19]
+%   {\__file_name_quote:nN, \__file_name_quote:VN}
+%   \begin{syntax}
+%     \cs{__file_name_quote:nn} \Arg{name} \Arg{str var}
+%   \end{syntax}
+%   Set the \meta{str var} to the \meta{name} quoted using |"| at each
+%   end if required by the presence of spaces in the \meta{name}. Any existing
+%   |"| tokens will be removed.
 % \end{function}
 %
 % \subsection{Internal input--output functions}
@@ -625,7 +632,7 @@
 %   higher-level
 %   functions which have already fully expanded the \meta{file name} and which
 %   need to perform multiple open or close operations. See for example the
-%   implementation of \cs{file_add_path:nN},
+%   implementation of \cs{file_find:nN},
 % \end{function}
 %
 % \begin{function}[added = 2014-08-23]{\__iow_with:Nnn}
@@ -659,23 +666,23 @@
 %
 % \subsection{File operations}
 %
-% \begin{variable}{\g_file_current_name_tl}
+% \begin{variable}{\g_file_current_name_str}
 %   The name of the current file should be available at all times.
 %   For the format the file name needs to be picked up at the start of the
 %   file. In \LaTeXe{} package mode the current file name is collected from
 %   \tn{@currname}.
 %    \begin{macrocode}
-\tl_new:N \g_file_current_name_tl
+\str_new:N \g_file_current_name_str
 %<*initex>
 \tex_everyjob:D \exp_after:wN
   {
     \tex_the:D \tex_everyjob:D
-    \tl_gset:Nx \g_file_current_name_tl { \tex_jobname:D }
+    \str_gset:Nx \g_file_current_name_str { \tex_jobname:D }
   }
 %</initex>
 %<*package>
 \cs_if_exist:NT \@currname
-  { \tl_gset_eq:NN \g_file_current_name_tl \@currname }
+  { \str_gset_eq:NN \g_file_current_name_str \@currname }
 %</package>
 %    \end{macrocode}
 % \end{variable}
@@ -705,25 +712,25 @@
 %    \end{macrocode}
 % \end{variable}
 %
-% \begin{variable}{\l_@@_internal_tl}
-%   Used as a short-term scratch variable.  It may be possible to reuse
-%   \cs{l_@@_internal_name_tl} there.
+% \begin{variable}{\l_@@_tmp_tl}
+%   Used as a short-term scratch variable.
 %    \begin{macrocode}
-\tl_new:N \l_@@_internal_tl
+\tl_new:N \l_@@_tmp_tl
 %    \end{macrocode}
 % \end{variable}
 %
-% \begin{variable}{\l_@@_internal_name_tl}
-%   Used to return the fully-qualified name of a file.
+% \begin{variable}{\l__file_name_str, \l__file_path_str}
+%   For storing the name and full path whilst passing data internally.
 %    \begin{macrocode}
-\tl_new:N \l_@@_internal_name_tl
+\str_new:N \l__file_name_str
+\str_new:N \l__file_path_str
 %    \end{macrocode}
 % \end{variable}
 %
-% \begin{variable}{\l_@@_search_path_seq}
+% \begin{variable}{\l_file_search_path_seq}
 %   The current search path.
 %    \begin{macrocode}
-\seq_new:N \l_@@_search_path_seq
+\seq_new:N \l_file_search_path_seq
 %    \end{macrocode}
 % \end{variable}
 %
@@ -736,16 +743,17 @@
 %    \end{macrocode}
 % \end{variable}
 %
-% \begin{variable}{\l_@@_internal_seq}
+% \begin{variable}{\l_@@_tmp_seq}
 %   Scratch space for comma list conversion in package mode.
 %    \begin{macrocode}
 %<*package>
-\seq_new:N \l_@@_internal_seq
+\seq_new:N \l_@@_tmp_seq
 %</package>
 %    \end{macrocode}
 % \end{variable}
 %
-% \begin{macro}[int]{\@@_name_sanitize:nn}
+% \begin{macro}[int]{\__file_name_sanitize:nN}
+% \begin{macro}[int]{\__file_name_quote:nN, \__file_name_quote:VN}
 % \begin{macro}[int, aux]{\@@_name_sanitize_aux:n}
 %   For converting a token list to a string where active characters are treated
 %   as strings from the start. The logic to the quoting normalisation is the
@@ -753,54 +761,53 @@
 %   assuming they balance strip all of them out before quoting the entire name
 %   if it contains spaces.
 %    \begin{macrocode}
-\cs_new_protected:Npn \@@_name_sanitize:nn #1#2
+\cs_new_protected:Npn \__file_name_sanitize:nN #1#2
   {
     \group_begin:
       \seq_map_inline:Nn \l_char_active_seq
         {
-          \tl_set:Nx \l_@@_internal_tl { \iow_char:N ##1 }
-          \char_set_active_eq:NN ##1 \l_@@_internal_tl
-        }
-      \tl_set:Nx \l_@@_internal_name_tl {#1}
-      \tl_set:Nx \l_@@_internal_name_tl
-        { \tl_to_str:N \l_@@_internal_name_tl }
-      \int_compare:nNnTF
-        {
-          \int_mod:nn
-            {
-              0 \tl_map_function:NN \l_@@_internal_name_tl
-                \@@_name_sanitize_aux:n
-            }
-            { 2 }
-        }
-        = 0
-        {
-          \tl_remove_all:Nn \l_@@_internal_name_tl { " }
-          \tl_if_in:NnT \l_@@_internal_name_tl { ~ }
-            {
-              \tl_set:Nx \l_@@_internal_name_tl
-                { " \exp_not:V \l_@@_internal_name_tl " }
-            }
-        }
-        {
-          \__msg_kernel_error:nnx
-            { kernel } { unbalanced-quote-in-filename }
-            { \l_@@_internal_name_tl }
-        }
-      \use:x
-        {
-          \group_end:
-          \exp_not:n {#2} { \l_@@_internal_name_tl }
+          \tl_set:Nx \l_@@_tmp_tl { \iow_char:N ##1 }
+          \char_set_active_eq:NN ##1 \l_@@_tmp_tl
         }
+      \tl_set:Nx \l_@@_tmp_tl {#1}
+      \tl_set:Nx \l_@@_tmp_tl
+        { \tl_to_str:N \l_@@_tmp_tl }
+    \exp_args:NNNV \group_end:
+    \str_set:Nn #2 \l_@@_tmp_tl
   }
-\cs_new:Npn \@@_name_sanitize_aux:n #1
+\cs_new_protected:Npn \__file_name_quote:nN #1#2
+  {
+    \str_set:Nn #2 {#1}
+    \int_compare:nNnTF
+      {
+        \int_mod:nn
+          {
+            0 \tl_map_function:NN #2
+              \@@_name_quote_aux:n
+          }
+          { 2 }
+      }
+      = 0
+      {
+        \tl_remove_all:Nn #2 { " }
+        \tl_if_in:NnT #2 { ~ }
+          { \str_set:Nx #2 { " \exp_not:V #2 " } }
+      }
+      {
+        \__msg_kernel_error:nnx
+          { kernel } { unbalanced-quote-in-filename } {#2}
+      }
+  }
+\cs_generate_variant:Nn \__file_name_quote:nN { V }
+\cs_new:Npn \@@_name_quote_aux:n #1
   { \token_if_eq_charcode:NNT #1 " { + 1 } }
 %    \end{macrocode}
 % \end{macro}
 % \end{macro}
+% \end{macro}
 %
-% \begin{macro}{\file_add_path:nN}
-% \begin{macro}[aux]{\@@_add_path:nN, \@@_add_path_search:nN}
+% \begin{macro}{\file_find:nN, \file_find:VN}
+% \begin{macro}[aux]{\@@_find_search:N}
 %   The way to test if a file exists is to try to open it: if it does not
 %   exist then \TeX{} will report end-of-file. For files which are in the
 %   current directory, this is straight-forward.  For other locations, a
@@ -808,42 +815,46 @@
 %   location is of course treated as the correct one. If nothing is found,
 %   |#2| is returned empty.
 %    \begin{macrocode}
-\cs_new_protected:Npn \file_add_path:nN #1
-  { \@@_name_sanitize:nn {#1} { \@@_add_path:nN } }
-\cs_new_protected:Npn \@@_add_path:nN #1#2
+\cs_new_protected:Npn \file_find:nN #1#2
   {
-    \__ior_open:Nn \g_@@_internal_ior {#1}
+    \__file_name_sanitize:nN {#1} \l__file_name_str
+    \__file_name_quote:VN \l__file_name_str \l__file_path_str
+    \__ior_open:No \g_@@_internal_ior \l__file_path_str
     \ior_if_eof:NTF \g_@@_internal_ior
-      { \@@_add_path_search:nN {#1} #2 }
-      { \tl_set:Nn #2 {#1} }
+      { \@@_find_search:N #2 }
+      { \str_set_eq:NN #2 \l__file_path_str }
     \ior_close:N \g_@@_internal_ior
   }
-\cs_new_protected:Npn \@@_add_path_search:nN #1#2
+\cs_generate_variant:Nn \file_find:nN { V }
+\cs_new_protected:Npn \@@_find_search:N #1
   {
-    \tl_set:Nn #2 { \q_no_value  }
+    \str_clear:N #1
 %<*package>
     \cs_if_exist:NT \input at path
       {
         \seq_set_eq:NN \l_@@_saved_search_path_seq
-          \l_@@_search_path_seq
-        \seq_set_split:NnV \l_@@_internal_seq { , } \input at path
-        \seq_concat:NNN \l_@@_search_path_seq
-          \l_@@_search_path_seq \l_@@_internal_seq
+          \l_file_search_path_seq
+        \seq_set_split:NnV \l_@@_tmp_seq { , } \input at path
+        \seq_concat:NNN \l_file_search_path_seq
+          \l_file_search_path_seq \l_@@_tmp_seq
       }
 %</package>
-    \seq_map_inline:Nn \l_@@_search_path_seq
+    \seq_map_inline:Nn \l_file_search_path_seq
       {
-        \__ior_open:Nn \g_@@_internal_ior { ##1 #1 }
+        \str_set:Nx \l__file_path_str
+          { \tl_to_str:n {##1} \l__file_name_str }
+        \__file_name_quote:VN \l__file_path_str \l__file_path_str
+        \__ior_open:NV \g_@@_internal_ior \l__file_path_str
         \ior_if_eof:NF \g_@@_internal_ior
           {
-            \tl_set:Nx #2 { ##1 #1 }
+            \str_set_eq:NN #1 \l__file_path_str
             \seq_map_break:
           }
       }
 %<*package>
     \cs_if_exist:NT \input at path
       {
-        \seq_set_eq:NN \l_@@_search_path_seq
+        \seq_set_eq:NN \l_file_search_path_seq
           \l_@@_saved_search_path_seq
       }
 %</package>
@@ -853,6 +864,7 @@
 % \end{macro}
 %
 % \begin{macro}[TF]{\file_if_exist:n}
+% \begin{macro}[TF]{\file_if_exist:nN}
 %   The test for the existence of a file is a wrapper around the function to
 %   add a path to a file. If the file was found, the path will contain
 %   something, whereas if the file was not located then the return value
@@ -860,16 +872,24 @@
 %    \begin{macrocode}
 \prg_new_protected_conditional:Npnn \file_if_exist:n #1 { T , F , TF }
   {
-    \file_add_path:nN {#1} \l_@@_internal_name_tl
-    \quark_if_no_value:NTF \l_@@_internal_name_tl
+    \file_find:nN {#1} \l__file_path_str
+    \str_if_empty:NTF \l__file_path_str
+      { \prg_return_false: }
+      { \prg_return_true: }
+  }
+\prg_new_protected_conditional:Npnn \file_if_exist:nN #1#2 { T , F , TF }
+  {
+    \file_find:nN {#1} #2
+    \str_if_empty:NTF #2
       { \prg_return_false: }
       { \prg_return_true: }
   }
 %    \end{macrocode}
 % \end{macro}
+% \end{macro}
 %
 % \begin{macro}{\file_input:n}
-% \begin{macro}[int]{\@@_if_exist:nT}
+% \begin{macro}[aux]{\@@_missing:n}
 % \begin{macro}[aux]{\@@_input:n, \@@_input:V}
 % \begin{macro}[aux]{\@@_input_aux:n, \@@_input_aux:o}
 %   Loading a file is done in a safe way, checking first that the file
@@ -879,21 +899,15 @@
 %    \begin{macrocode}
 \cs_new_protected:Npn \file_input:n #1
   {
-    \@@_if_exist:nT {#1}
-      { \@@_input:V \l_@@_internal_name_tl }
+    \file_if_exist:nNTF {#1} \l__file_path_str
+      { \@@_input:V \l__file_path_str }
+      { \@@_missing:n {#1} }
   }
-%    \end{macrocode}
-%   This code is spun out as a separate function to encapsulate the
-%   error message into a easy-to-reuse form.
-%    \begin{macrocode}
-\cs_new_protected:Npn \@@_if_exist:nT #1#2
+\cs_new_protected:Npn \@@_missing:n #1
   {
-    \file_if_exist:nTF {#1}
-      {#2}
-      {
-        \@@_name_sanitize:nn {#1}
-          { \__msg_kernel_error:nnx { kernel } { file-not-found } }
-      }
+    \__file_name_sanitize:nN {#1} \l__file_name_str
+    \__msg_kernel_error:nnx { kernel } { file-not-found }
+      { \l__file_name_str }
   }
 \cs_new_protected:Npn \@@_input:n #1
   {
@@ -915,8 +929,8 @@
     \seq_gpush:No \g_@@_stack_seq \g_file_current_name_tl
     \tl_gset:Nn \g_file_current_name_tl {#1}
     \tex_input:D #1 \c_space_tl
-    \seq_gpop:NN \g_@@_stack_seq \l_@@_internal_tl
-    \tl_gset_eq:NN \g_file_current_name_tl \l_@@_internal_tl
+    \seq_gpop:NN \g_@@_stack_seq \l_@@_tmp_tl
+    \tl_gset_eq:NN \g_file_current_name_tl \l_@@_tmp_tl
   }
 \cs_generate_variant:Nn \@@_input_aux:n { o }
 %    \end{macrocode}
@@ -925,28 +939,6 @@
 % \end{macro}
 % \end{macro}
 %
-% \begin{macro}{\file_path_include:n}
-% \begin{macro}{\file_path_remove:n}
-% \begin{macro}[aux]{\@@_path_include:n}
-%   Wrapper functions to manage the search path.
-%    \begin{macrocode}
-\cs_new_protected:Npn \file_path_include:n #1
-  { \@@_name_sanitize:nn {#1} { \@@_path_include:n } }
-\cs_new_protected:Npn \@@_path_include:n #1
-  {
-    \seq_if_in:NnF \l_@@_search_path_seq {#1}
-      { \seq_put_right:Nn \l_@@_search_path_seq {#1} }
-  }
-\cs_new_protected:Npn \file_path_remove:n #1
-  {
-    \@@_name_sanitize:nn {#1}
-      { \seq_remove_all:Nn \l_@@_search_path_seq }
-  }
-%    \end{macrocode}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-%
 % \begin{macro}{\file_list:}
 %   A function to list all files used to the log, without duplicates.
 %   In package mode, if \cs{@filelist} is still defined, we need to take
@@ -956,20 +948,20 @@
 %    \begin{macrocode}
 \cs_new_protected:Npn \file_list:
   {
-    \seq_set_eq:NN \l_@@_internal_seq \g_@@_record_seq
+    \seq_set_eq:NN \l_@@_tmp_seq \g_@@_record_seq
 %<*package>
     \clist_if_exist:NT \@filelist
       {
         \clist_map_inline:Nn \@filelist
           {
-            \seq_put_right:No \l_@@_internal_seq
+            \seq_put_right:No \l_@@_tmp_seq
               { \tl_to_str:n {##1} }
           }
       }
 %</package>
-    \seq_remove_duplicates:N \l_@@_internal_seq
+    \seq_remove_duplicates:N \l_@@_tmp_seq
     \iow_log:n { *~File~List~* }
-    \seq_map_inline:Nn \l_@@_internal_seq { \iow_log:n {##1} }
+    \seq_map_inline:Nn \l_@@_tmp_seq { \iow_log:n {##1} }
     \iow_log:n { ************* }
   }
 %    \end{macrocode}
@@ -1070,7 +1062,6 @@
 % \end{macro}
 %
 % \begin{macro}{\ior_open:Nn, \ior_open:cn}
-% \begin{macro}[aux]{\@@_open_aux:Nn}
 %   Opening an input stream requires a bit of pre-processing. The file name
 %   is sanitized to deal with active characters, before an auxiliary adds a
 %   path and checks that the file really exists. If those two tests pass, then
@@ -1078,42 +1069,38 @@
 %   streams.
 %    \begin{macrocode}
 \cs_new_protected:Npn \ior_open:Nn #1#2
-  { \__file_name_sanitize:nn {#2} { \@@_open_aux:Nn #1 } }
-\cs_generate_variant:Nn \ior_open:Nn { c }
-\cs_new_protected:Npn \@@_open_aux:Nn #1#2
   {
-    \file_add_path:nN {#2} \l__file_internal_name_tl
-    \quark_if_no_value:NTF \l__file_internal_name_tl
-      { \__msg_kernel_error:nnx { kernel } { file-not-found } {#2} }
-      { \@@_open:No #1 \l__file_internal_name_tl }
+    \file_find:nN {#2} \l__file_path_str
+    \str_if_empty:NTF \l__file_path_str
+      {
+        \__file_name_sanitize:nN {#2} \l__file_name_str
+        \__msg_kernel_error:nnx { kernel } { file-not-found } \l__file_name_str
+      }
+      { \@@_open:No #1 \l__file_path_str }
   }
+\cs_generate_variant:Nn \ior_open:Nn { c }
 %    \end{macrocode}
 % \end{macro}
-% \end{macro}
 %
 % \begin{macro}[TF]{\ior_open:Nn, \ior_open:cn}
-% \begin{macro}[aux]{\@@_open_aux:NnTF}
 %   Much the same idea for opening a read with a conditional, except the
 %   auxiliary function does not issue an error if the file is not found.
 %    \begin{macrocode}
 \prg_new_protected_conditional:Npnn \ior_open:Nn #1#2 { T , F , TF }
-  { \__file_name_sanitize:nn {#2} { \@@_open_aux:NnTF #1 } }
-\cs_generate_variant:Nn \ior_open:NnT  { c }
-\cs_generate_variant:Nn \ior_open:NnF  { c }
-\cs_generate_variant:Nn \ior_open:NnTF { c }
-\cs_new_protected:Npn \@@_open_aux:NnTF #1#2
   {
-    \file_add_path:nN {#2} \l__file_internal_name_tl
-    \quark_if_no_value:NTF \l__file_internal_name_tl
+    \file_find:VN \l__file_name_str \l__file_path_str
+    \str_if_empty:NTF \l__file_path_str
       { \prg_return_false: }
       {
-        \@@_open:No #1 \l__file_internal_name_tl
+        \@@_open:No #1 \l__file_path_str
         \prg_return_true:
       }
   }
+\cs_generate_variant:Nn \ior_open:NnT  { c }
+\cs_generate_variant:Nn \ior_open:NnF  { c }
+\cs_generate_variant:Nn \ior_open:NnTF { c }
 %    \end{macrocode}
 % \end{macro}
-% \end{macro}
 %
 % \begin{macro}[int]{\@@_new:N}
 %   In package mode, streams are reserved using \tn{newread} before they
@@ -1437,19 +1424,16 @@
 % \end{macro}
 %
 % \begin{macro}{\iow_open:Nn, \iow_open:cn}
-% \begin{macro}[int]{\@@_open:Nn}
-% \begin{macro}[aux]{\@@_open_stream:Nn}
+% \begin{macro}[aux]{\@@_open_stream:Nn, \@@_open_stream:NV}
 %   The same idea as for reading, but without the path and without the need
 %   to allow for a conditional version.
 %    \begin{macrocode}
 \cs_new_protected:Npn \iow_open:Nn #1#2
-  { \__file_name_sanitize:nn {#2} { \@@_open:Nn #1 } }
-\cs_generate_variant:Nn \iow_open:Nn { c }
-\cs_new_protected:Npn \@@_open:Nn #1#2
   {
+    \__file_name_sanitize:nN {#2} \l__file_name_str
     \iow_close:N #1
     \seq_gpop:NNTF \g_@@_streams_seq \l_@@_stream_tl
-      { \@@_open_stream:Nn #1 {#2} }
+      { \@@_open_stream:NV #1 \l__file_name_str }
 %<*initex>
       { \__msg_kernel_fatal:nn { kernel } { output-streams-exhausted } }
 %</initex>
@@ -1457,21 +1441,21 @@
       {
         \@@_new:N #1
         \tl_set:Nx \l_@@_stream_tl { \int_eval:n {#1} }
-        \@@_open_stream:Nn #1 {#2}
+        \@@_open_stream:NV #1 \l__file_name_str 
       }
 %</package>
   }
-\cs_generate_variant:Nn \@@_open:Nn { No }
+\cs_generate_variant:Nn \iow_open:Nn { c }
 \cs_new_protected:Npn \@@_open_stream:Nn #1#2
   {
     \tex_global:D \tex_chardef:D #1 = \l_@@_stream_tl \scan_stop:
     \prop_gput:NVn \g_@@_streams_prop #1 {#2}
     \tex_immediate:D \tex_openout:D #1 #2 \scan_stop:
   }
+\cs_generate_variant:Nn \@@_open_stream:Nn { NV }
 %    \end{macrocode}
 % \end{macro}
 % \end{macro}
-% \end{macro}
 %
 % \begin{macro}{\iow_close:N, \iow_close:c}
 %   Closing a stream is not quite the reverse of opening one. First,
@@ -2217,6 +2201,49 @@
 %
 % \subsection{Deprecated functions}
 %
+% \begin{variable}{\g_file_current_name_tl}
+%   For removal after 2018-12-31.
+%    \begin{macrocode}
+\tl_new:N \g_file_current_name_tl
+\tl_gset:Nn \g_file_current_name_tl { \g_file_current_name_str }
+%    \end{macrocode}
+% \end{variable}
+%
+% \begin{macro}{\file_path_include:n}
+% \begin{macro}{\file_path_remove:n}
+% \begin{macro}[aux]{\__file_path_include:n}
+%   Wrapper functions to manage the search path.
+%    \begin{macrocode}
+\cs_new_protected:Npn \file_path_include:n #1
+  {
+    \__file_name_sanitize:nN {#1} \l__file_path_str
+    \seq_if_in:NVF \l_file_search_path_seq \l__file_path_str
+      { \seq_put_right:NV \l_file_search_path_seq \l__file_path_str }
+  }
+\cs_new_protected:Npn \file_path_remove:n #1
+  {
+    \__file_name_sanitize:nN {#1} \l__file_path_str
+    \seq_remove_all:NV \l_file_search_path_seq \l__file_path_str
+  }
+%    \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\file_add_path:nN}
+%   For removal after 2018-12-31.
+%    \begin{macrocode}
+\cs_new_protected:Npn \file_add_path:nN #1#2
+  {
+    \file_find:nN {#1} #2
+    \str_if_empty:NT #2
+      { \tl_set:Nn #2 { \q_no_value } }
+  }
+%    \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
 % \begin{macro}[added = 2012-06-24, updated = 2012-07-31, deprecated=2017-12-31]{\ior_get_str:NN}
 %   For removal after 2017-12-31.
 %    \begin{macrocode}
diff --git a/l3kernel/l3msg.dtx b/l3kernel/l3msg.dtx
index 8e6a652..35664d6 100644
--- a/l3kernel/l3msg.dtx
+++ b/l3kernel/l3msg.dtx
@@ -922,7 +922,7 @@
 \tl_const:Nn \c_@@_continue_text_tl
   { Type~<return>~to~continue }
 \tl_const:Nn \c_@@_critical_text_tl
-  { Reading~the~current~file~'\g_file_current_name_tl'~will~stop. }
+  { Reading~the~current~file~'\g_file_current_name_str'~will~stop. }
 \tl_const:Nn \c_@@_fatal_text_tl
   { This~is~a~fatal~error:~LaTeX~will~abort. }
 \tl_const:Nn \c_@@_help_text_tl
diff --git a/l3kernel/l3obsolete.txt b/l3kernel/l3obsolete.txt
index 5d8e254..5119594 100644
--- a/l3kernel/l3obsolete.txt
+++ b/l3kernel/l3obsolete.txt
@@ -18,6 +18,10 @@ Function                   Expires end
 \c_minus_one                      2018
 \box_resize:cnn                   2018
 \box_resize:Nnn                   2018
+\file_add_path:nN                 2018
+\file_path_include:n              2018
+\file_path_remove:n               2018
+\g_file_current_name_tl           2018
 \ior_get_str:NN                   2017
 \sort_ordered:                    2018
 \sort_reversed:                   2018
diff --git a/l3kernel/testfiles/m3expl001.luatex.tlg b/l3kernel/testfiles/m3expl001.luatex.tlg
index daae3a2..ed4bd2c 100644
--- a/l3kernel/testfiles/m3expl001.luatex.tlg
+++ b/l3kernel/testfiles/m3expl001.luatex.tlg
@@ -2836,31 +2836,34 @@ Defining \__msg_show_wrap_aux:w on line ...
 Defining \__msg_show_item:n on line ...
 Defining \__msg_show_item:nn on line ...
 Defining \__msg_show_item_unbraced:nn on line ...
-Defining \g_file_current_name_tl on line ...
+Defining \g_file_current_name_str on line ...
 Defining \g__file_stack_seq on line ...
 Defining \g__file_record_seq on line ...
-Defining \l__file_internal_tl on line ...
-Defining \l__file_internal_name_tl on line ...
-Defining \l__file_search_path_seq on line ...
+Defining \l__file_tmp_tl on line ...
+Defining \l__file_name_str on line ...
+Defining \l__file_path_str on line ...
+Defining \l_file_search_path_seq on line ...
 Defining \l__file_saved_search_path_seq on line ...
-Defining \l__file_internal_seq on line ...
-Defining \__file_name_sanitize:nn on line ...
-Defining \__file_name_sanitize_aux:n on line ...
-Defining \file_add_path:nN on line ...
-Defining \__file_add_path:nN on line ...
-Defining \__file_add_path_search:nN on line ...
+Defining \l__file_tmp_seq on line ...
+Defining \__file_name_sanitize:nN on line ...
+Defining \__file_name_quote:nN on line ...
+Defining \__file_name_quote:VN on line ...
+Defining \__file_name_quote_aux:n on line ...
+Defining \file_find:nN on line ...
+Defining \file_find:VN on line ...
+Defining \__file_find_search:N on line ...
 Defining \file_if_exist:nT on line ...
 Defining \file_if_exist:nF on line ...
 Defining \file_if_exist:nTF on line ...
+Defining \file_if_exist:nNT on line ...
+Defining \file_if_exist:nNF on line ...
+Defining \file_if_exist:nNTF on line ...
 Defining \file_input:n on line ...
-Defining \__file_if_exist:nT on line ...
+Defining \__file_missing:n on line ...
 Defining \__file_input:n on line ...
 Defining \__file_input:V on line ...
 Defining \__file_input_aux:n on line ...
 Defining \__file_input_aux:o on line ...
-Defining \file_path_include:n on line ...
-Defining \__file_path_include:n on line ...
-Defining \file_path_remove:n on line ...
 Defining \file_list: on line ...
 Defining \c_term_ior on line ...
 Defining \g__ior_streams_seq on line ...
@@ -2870,14 +2873,12 @@ Defining \ior_new:N on line ...
 Defining \ior_new:c on line ...
 Defining \ior_open:Nn on line ...
 Defining \ior_open:cn on line ...
-Defining \__ior_open_aux:Nn on line ...
 Defining \ior_open:NnT on line ...
 Defining \ior_open:NnF on line ...
 Defining \ior_open:NnTF on line ...
 Defining \ior_open:cnT on line ...
 Defining \ior_open:cnF on line ...
 Defining \ior_open:cnTF on line ...
-Defining \__ior_open_aux:NnTF on line ...
 Defining \__ior_new:N on line ...
 Defining \__ior_open:Nn on line ...
 Defining \__ior_open:No on line ...
@@ -2913,9 +2914,8 @@ Defining \iow_new:c on line ...
 Defining \__iow_new:N on line ...
 Defining \iow_open:Nn on line ...
 Defining \iow_open:cn on line ...
-Defining \__iow_open:Nn on line ...
-Defining \__iow_open:No on line ...
 Defining \__iow_open_stream:Nn on line ...
+Defining \__iow_open_stream:NV on line ...
 Defining \iow_close:N on line ...
 Defining \iow_close:c on line ...
 Defining \iow_list_streams: on line ...
@@ -2994,6 +2994,10 @@ Defining message LaTeX/kernel/input-streams-exhausted on line ...
 Defining message LaTeX/kernel/output-streams-exhausted on line ...
 Defining message LaTeX/kernel/unbalanced-quote-in-filename on line ...
 Defining message LaTeX/kernel/iow-indent on line ...
+Defining \g_file_current_name_tl on line ...
+Defining \file_path_include:n on line ...
+Defining \file_path_remove:n on line ...
+Defining \file_add_path:nN on line ...
 Defining \ior_get_str:NN on line ...
 Defining \if_dim:w on line ...
 Defining \__dim_eval:w on line ...
diff --git a/l3kernel/testfiles/m3expl001.ptex.tlg b/l3kernel/testfiles/m3expl001.ptex.tlg
index 23a5592..afb193e 100644
--- a/l3kernel/testfiles/m3expl001.ptex.tlg
+++ b/l3kernel/testfiles/m3expl001.ptex.tlg
@@ -2824,31 +2824,34 @@ Defining \__msg_show_wrap_aux:w on line ...
 Defining \__msg_show_item:n on line ...
 Defining \__msg_show_item:nn on line ...
 Defining \__msg_show_item_unbraced:nn on line ...
-Defining \g_file_current_name_tl on line ...
+Defining \g_file_current_name_str on line ...
 Defining \g__file_stack_seq on line ...
 Defining \g__file_record_seq on line ...
-Defining \l__file_internal_tl on line ...
-Defining \l__file_internal_name_tl on line ...
-Defining \l__file_search_path_seq on line ...
+Defining \l__file_tmp_tl on line ...
+Defining \l__file_name_str on line ...
+Defining \l__file_path_str on line ...
+Defining \l_file_search_path_seq on line ...
 Defining \l__file_saved_search_path_seq on line ...
-Defining \l__file_internal_seq on line ...
-Defining \__file_name_sanitize:nn on line ...
-Defining \__file_name_sanitize_aux:n on line ...
-Defining \file_add_path:nN on line ...
-Defining \__file_add_path:nN on line ...
-Defining \__file_add_path_search:nN on line ...
+Defining \l__file_tmp_seq on line ...
+Defining \__file_name_sanitize:nN on line ...
+Defining \__file_name_quote:nN on line ...
+Defining \__file_name_quote:VN on line ...
+Defining \__file_name_quote_aux:n on line ...
+Defining \file_find:nN on line ...
+Defining \file_find:VN on line ...
+Defining \__file_find_search:N on line ...
 Defining \file_if_exist:nT on line ...
 Defining \file_if_exist:nF on line ...
 Defining \file_if_exist:nTF on line ...
+Defining \file_if_exist:nNT on line ...
+Defining \file_if_exist:nNF on line ...
+Defining \file_if_exist:nNTF on line ...
 Defining \file_input:n on line ...
-Defining \__file_if_exist:nT on line ...
+Defining \__file_missing:n on line ...
 Defining \__file_input:n on line ...
 Defining \__file_input:V on line ...
 Defining \__file_input_aux:n on line ...
 Defining \__file_input_aux:o on line ...
-Defining \file_path_include:n on line ...
-Defining \__file_path_include:n on line ...
-Defining \file_path_remove:n on line ...
 Defining \file_list: on line ...
 Defining \c_term_ior on line ...
 Defining \g__ior_streams_seq on line ...
@@ -2858,14 +2861,12 @@ Defining \ior_new:N on line ...
 Defining \ior_new:c on line ...
 Defining \ior_open:Nn on line ...
 Defining \ior_open:cn on line ...
-Defining \__ior_open_aux:Nn on line ...
 Defining \ior_open:NnT on line ...
 Defining \ior_open:NnF on line ...
 Defining \ior_open:NnTF on line ...
 Defining \ior_open:cnT on line ...
 Defining \ior_open:cnF on line ...
 Defining \ior_open:cnTF on line ...
-Defining \__ior_open_aux:NnTF on line ...
 Defining \__ior_new:N on line ...
 Defining \__ior_open:Nn on line ...
 Defining \__ior_open:No on line ...
@@ -2901,9 +2902,8 @@ Defining \iow_new:c on line ...
 Defining \__iow_new:N on line ...
 Defining \iow_open:Nn on line ...
 Defining \iow_open:cn on line ...
-Defining \__iow_open:Nn on line ...
-Defining \__iow_open:No on line ...
 Defining \__iow_open_stream:Nn on line ...
+Defining \__iow_open_stream:NV on line ...
 Defining \iow_close:N on line ...
 Defining \iow_close:c on line ...
 Defining \iow_list_streams: on line ...
@@ -2982,6 +2982,10 @@ Defining message LaTeX/kernel/input-streams-exhausted on line ...
 Defining message LaTeX/kernel/output-streams-exhausted on line ...
 Defining message LaTeX/kernel/unbalanced-quote-in-filename on line ...
 Defining message LaTeX/kernel/iow-indent on line ...
+Defining \g_file_current_name_tl on line ...
+Defining \file_path_include:n on line ...
+Defining \file_path_remove:n on line ...
+Defining \file_add_path:nN on line ...
 Defining \ior_get_str:NN on line ...
 Defining \if_dim:w on line ...
 Defining \__dim_eval:w on line ...
diff --git a/l3kernel/testfiles/m3expl001.tlg b/l3kernel/testfiles/m3expl001.tlg
index 148c6df..5dd5645 100644
--- a/l3kernel/testfiles/m3expl001.tlg
+++ b/l3kernel/testfiles/m3expl001.tlg
@@ -2824,31 +2824,34 @@ Defining \__msg_show_wrap_aux:w on line ...
 Defining \__msg_show_item:n on line ...
 Defining \__msg_show_item:nn on line ...
 Defining \__msg_show_item_unbraced:nn on line ...
-Defining \g_file_current_name_tl on line ...
+Defining \g_file_current_name_str on line ...
 Defining \g__file_stack_seq on line ...
 Defining \g__file_record_seq on line ...
-Defining \l__file_internal_tl on line ...
-Defining \l__file_internal_name_tl on line ...
-Defining \l__file_search_path_seq on line ...
+Defining \l__file_tmp_tl on line ...
+Defining \l__file_name_str on line ...
+Defining \l__file_path_str on line ...
+Defining \l_file_search_path_seq on line ...
 Defining \l__file_saved_search_path_seq on line ...
-Defining \l__file_internal_seq on line ...
-Defining \__file_name_sanitize:nn on line ...
-Defining \__file_name_sanitize_aux:n on line ...
-Defining \file_add_path:nN on line ...
-Defining \__file_add_path:nN on line ...
-Defining \__file_add_path_search:nN on line ...
+Defining \l__file_tmp_seq on line ...
+Defining \__file_name_sanitize:nN on line ...
+Defining \__file_name_quote:nN on line ...
+Defining \__file_name_quote:VN on line ...
+Defining \__file_name_quote_aux:n on line ...
+Defining \file_find:nN on line ...
+Defining \file_find:VN on line ...
+Defining \__file_find_search:N on line ...
 Defining \file_if_exist:nT on line ...
 Defining \file_if_exist:nF on line ...
 Defining \file_if_exist:nTF on line ...
+Defining \file_if_exist:nNT on line ...
+Defining \file_if_exist:nNF on line ...
+Defining \file_if_exist:nNTF on line ...
 Defining \file_input:n on line ...
-Defining \__file_if_exist:nT on line ...
+Defining \__file_missing:n on line ...
 Defining \__file_input:n on line ...
 Defining \__file_input:V on line ...
 Defining \__file_input_aux:n on line ...
 Defining \__file_input_aux:o on line ...
-Defining \file_path_include:n on line ...
-Defining \__file_path_include:n on line ...
-Defining \file_path_remove:n on line ...
 Defining \file_list: on line ...
 Defining \c_term_ior on line ...
 Defining \g__ior_streams_seq on line ...
@@ -2858,14 +2861,12 @@ Defining \ior_new:N on line ...
 Defining \ior_new:c on line ...
 Defining \ior_open:Nn on line ...
 Defining \ior_open:cn on line ...
-Defining \__ior_open_aux:Nn on line ...
 Defining \ior_open:NnT on line ...
 Defining \ior_open:NnF on line ...
 Defining \ior_open:NnTF on line ...
 Defining \ior_open:cnT on line ...
 Defining \ior_open:cnF on line ...
 Defining \ior_open:cnTF on line ...
-Defining \__ior_open_aux:NnTF on line ...
 Defining \__ior_new:N on line ...
 Defining \__ior_open:Nn on line ...
 Defining \__ior_open:No on line ...
@@ -2901,9 +2902,8 @@ Defining \iow_new:c on line ...
 Defining \__iow_new:N on line ...
 Defining \iow_open:Nn on line ...
 Defining \iow_open:cn on line ...
-Defining \__iow_open:Nn on line ...
-Defining \__iow_open:No on line ...
 Defining \__iow_open_stream:Nn on line ...
+Defining \__iow_open_stream:NV on line ...
 Defining \iow_close:N on line ...
 Defining \iow_close:c on line ...
 Defining \iow_list_streams: on line ...
@@ -2982,6 +2982,10 @@ Defining message LaTeX/kernel/input-streams-exhausted on line ...
 Defining message LaTeX/kernel/output-streams-exhausted on line ...
 Defining message LaTeX/kernel/unbalanced-quote-in-filename on line ...
 Defining message LaTeX/kernel/iow-indent on line ...
+Defining \g_file_current_name_tl on line ...
+Defining \file_path_include:n on line ...
+Defining \file_path_remove:n on line ...
+Defining \file_add_path:nN on line ...
 Defining \ior_get_str:NN on line ...
 Defining \if_dim:w on line ...
 Defining \__dim_eval:w on line ...
diff --git a/l3kernel/testfiles/m3expl001.uptex.tlg b/l3kernel/testfiles/m3expl001.uptex.tlg
index 681cde1..bb0ab5b 100644
--- a/l3kernel/testfiles/m3expl001.uptex.tlg
+++ b/l3kernel/testfiles/m3expl001.uptex.tlg
@@ -2824,31 +2824,34 @@ Defining \__msg_show_wrap_aux:w on line ...
 Defining \__msg_show_item:n on line ...
 Defining \__msg_show_item:nn on line ...
 Defining \__msg_show_item_unbraced:nn on line ...
-Defining \g_file_current_name_tl on line ...
+Defining \g_file_current_name_str on line ...
 Defining \g__file_stack_seq on line ...
 Defining \g__file_record_seq on line ...
-Defining \l__file_internal_tl on line ...
-Defining \l__file_internal_name_tl on line ...
-Defining \l__file_search_path_seq on line ...
+Defining \l__file_tmp_tl on line ...
+Defining \l__file_name_str on line ...
+Defining \l__file_path_str on line ...
+Defining \l_file_search_path_seq on line ...
 Defining \l__file_saved_search_path_seq on line ...
-Defining \l__file_internal_seq on line ...
-Defining \__file_name_sanitize:nn on line ...
-Defining \__file_name_sanitize_aux:n on line ...
-Defining \file_add_path:nN on line ...
-Defining \__file_add_path:nN on line ...
-Defining \__file_add_path_search:nN on line ...
+Defining \l__file_tmp_seq on line ...
+Defining \__file_name_sanitize:nN on line ...
+Defining \__file_name_quote:nN on line ...
+Defining \__file_name_quote:VN on line ...
+Defining \__file_name_quote_aux:n on line ...
+Defining \file_find:nN on line ...
+Defining \file_find:VN on line ...
+Defining \__file_find_search:N on line ...
 Defining \file_if_exist:nT on line ...
 Defining \file_if_exist:nF on line ...
 Defining \file_if_exist:nTF on line ...
+Defining \file_if_exist:nNT on line ...
+Defining \file_if_exist:nNF on line ...
+Defining \file_if_exist:nNTF on line ...
 Defining \file_input:n on line ...
-Defining \__file_if_exist:nT on line ...
+Defining \__file_missing:n on line ...
 Defining \__file_input:n on line ...
 Defining \__file_input:V on line ...
 Defining \__file_input_aux:n on line ...
 Defining \__file_input_aux:o on line ...
-Defining \file_path_include:n on line ...
-Defining \__file_path_include:n on line ...
-Defining \file_path_remove:n on line ...
 Defining \file_list: on line ...
 Defining \c_term_ior on line ...
 Defining \g__ior_streams_seq on line ...
@@ -2858,14 +2861,12 @@ Defining \ior_new:N on line ...
 Defining \ior_new:c on line ...
 Defining \ior_open:Nn on line ...
 Defining \ior_open:cn on line ...
-Defining \__ior_open_aux:Nn on line ...
 Defining \ior_open:NnT on line ...
 Defining \ior_open:NnF on line ...
 Defining \ior_open:NnTF on line ...
 Defining \ior_open:cnT on line ...
 Defining \ior_open:cnF on line ...
 Defining \ior_open:cnTF on line ...
-Defining \__ior_open_aux:NnTF on line ...
 Defining \__ior_new:N on line ...
 Defining \__ior_open:Nn on line ...
 Defining \__ior_open:No on line ...
@@ -2901,9 +2902,8 @@ Defining \iow_new:c on line ...
 Defining \__iow_new:N on line ...
 Defining \iow_open:Nn on line ...
 Defining \iow_open:cn on line ...
-Defining \__iow_open:Nn on line ...
-Defining \__iow_open:No on line ...
 Defining \__iow_open_stream:Nn on line ...
+Defining \__iow_open_stream:NV on line ...
 Defining \iow_close:N on line ...
 Defining \iow_close:c on line ...
 Defining \iow_list_streams: on line ...
@@ -2982,6 +2982,10 @@ Defining message LaTeX/kernel/input-streams-exhausted on line ...
 Defining message LaTeX/kernel/output-streams-exhausted on line ...
 Defining message LaTeX/kernel/unbalanced-quote-in-filename on line ...
 Defining message LaTeX/kernel/iow-indent on line ...
+Defining \g_file_current_name_tl on line ...
+Defining \file_path_include:n on line ...
+Defining \file_path_remove:n on line ...
+Defining \file_add_path:nN on line ...
 Defining \ior_get_str:NN on line ...
 Defining \if_dim:w on line ...
 Defining \__dim_eval:w on line ...
diff --git a/l3kernel/testfiles/m3expl001.xetex.tlg b/l3kernel/testfiles/m3expl001.xetex.tlg
index 59fefdf..4bd556a 100644
--- a/l3kernel/testfiles/m3expl001.xetex.tlg
+++ b/l3kernel/testfiles/m3expl001.xetex.tlg
@@ -2834,31 +2834,34 @@ Defining \__msg_show_wrap_aux:w on line ...
 Defining \__msg_show_item:n on line ...
 Defining \__msg_show_item:nn on line ...
 Defining \__msg_show_item_unbraced:nn on line ...
-Defining \g_file_current_name_tl on line ...
+Defining \g_file_current_name_str on line ...
 Defining \g__file_stack_seq on line ...
 Defining \g__file_record_seq on line ...
-Defining \l__file_internal_tl on line ...
-Defining \l__file_internal_name_tl on line ...
-Defining \l__file_search_path_seq on line ...
+Defining \l__file_tmp_tl on line ...
+Defining \l__file_name_str on line ...
+Defining \l__file_path_str on line ...
+Defining \l_file_search_path_seq on line ...
 Defining \l__file_saved_search_path_seq on line ...
-Defining \l__file_internal_seq on line ...
-Defining \__file_name_sanitize:nn on line ...
-Defining \__file_name_sanitize_aux:n on line ...
-Defining \file_add_path:nN on line ...
-Defining \__file_add_path:nN on line ...
-Defining \__file_add_path_search:nN on line ...
+Defining \l__file_tmp_seq on line ...
+Defining \__file_name_sanitize:nN on line ...
+Defining \__file_name_quote:nN on line ...
+Defining \__file_name_quote:VN on line ...
+Defining \__file_name_quote_aux:n on line ...
+Defining \file_find:nN on line ...
+Defining \file_find:VN on line ...
+Defining \__file_find_search:N on line ...
 Defining \file_if_exist:nT on line ...
 Defining \file_if_exist:nF on line ...
 Defining \file_if_exist:nTF on line ...
+Defining \file_if_exist:nNT on line ...
+Defining \file_if_exist:nNF on line ...
+Defining \file_if_exist:nNTF on line ...
 Defining \file_input:n on line ...
-Defining \__file_if_exist:nT on line ...
+Defining \__file_missing:n on line ...
 Defining \__file_input:n on line ...
 Defining \__file_input:V on line ...
 Defining \__file_input_aux:n on line ...
 Defining \__file_input_aux:o on line ...
-Defining \file_path_include:n on line ...
-Defining \__file_path_include:n on line ...
-Defining \file_path_remove:n on line ...
 Defining \file_list: on line ...
 Defining \c_term_ior on line ...
 Defining \g__ior_streams_seq on line ...
@@ -2868,14 +2871,12 @@ Defining \ior_new:N on line ...
 Defining \ior_new:c on line ...
 Defining \ior_open:Nn on line ...
 Defining \ior_open:cn on line ...
-Defining \__ior_open_aux:Nn on line ...
 Defining \ior_open:NnT on line ...
 Defining \ior_open:NnF on line ...
 Defining \ior_open:NnTF on line ...
 Defining \ior_open:cnT on line ...
 Defining \ior_open:cnF on line ...
 Defining \ior_open:cnTF on line ...
-Defining \__ior_open_aux:NnTF on line ...
 Defining \__ior_new:N on line ...
 Defining \__ior_open:Nn on line ...
 Defining \__ior_open:No on line ...
@@ -2911,9 +2912,8 @@ Defining \iow_new:c on line ...
 Defining \__iow_new:N on line ...
 Defining \iow_open:Nn on line ...
 Defining \iow_open:cn on line ...
-Defining \__iow_open:Nn on line ...
-Defining \__iow_open:No on line ...
 Defining \__iow_open_stream:Nn on line ...
+Defining \__iow_open_stream:NV on line ...
 Defining \iow_close:N on line ...
 Defining \iow_close:c on line ...
 Defining \iow_list_streams: on line ...
@@ -2992,6 +2992,10 @@ Defining message LaTeX/kernel/input-streams-exhausted on line ...
 Defining message LaTeX/kernel/output-streams-exhausted on line ...
 Defining message LaTeX/kernel/unbalanced-quote-in-filename on line ...
 Defining message LaTeX/kernel/iow-indent on line ...
+Defining \g_file_current_name_tl on line ...
+Defining \file_path_include:n on line ...
+Defining \file_path_remove:n on line ...
+Defining \file_add_path:nN on line ...
 Defining \ior_get_str:NN on line ...
 Defining \if_dim:w on line ...
 Defining \__dim_eval:w on line ...
diff --git a/l3kernel/testfiles/m3expl003.luatex.tlg b/l3kernel/testfiles/m3expl003.luatex.tlg
index de37ee5..4ca6756 100644
--- a/l3kernel/testfiles/m3expl003.luatex.tlg
+++ b/l3kernel/testfiles/m3expl003.luatex.tlg
@@ -2837,31 +2837,34 @@ Defining \__msg_show_wrap_aux:w on line ...
 Defining \__msg_show_item:n on line ...
 Defining \__msg_show_item:nn on line ...
 Defining \__msg_show_item_unbraced:nn on line ...
-Defining \g_file_current_name_tl on line ...
+Defining \g_file_current_name_str on line ...
 Defining \g__file_stack_seq on line ...
 Defining \g__file_record_seq on line ...
-Defining \l__file_internal_tl on line ...
-Defining \l__file_internal_name_tl on line ...
-Defining \l__file_search_path_seq on line ...
+Defining \l__file_tmp_tl on line ...
+Defining \l__file_name_str on line ...
+Defining \l__file_path_str on line ...
+Defining \l_file_search_path_seq on line ...
 Defining \l__file_saved_search_path_seq on line ...
-Defining \l__file_internal_seq on line ...
-Defining \__file_name_sanitize:nn on line ...
-Defining \__file_name_sanitize_aux:n on line ...
-Defining \file_add_path:nN on line ...
-Defining \__file_add_path:nN on line ...
-Defining \__file_add_path_search:nN on line ...
+Defining \l__file_tmp_seq on line ...
+Defining \__file_name_sanitize:nN on line ...
+Defining \__file_name_quote:nN on line ...
+Defining \__file_name_quote:VN on line ...
+Defining \__file_name_quote_aux:n on line ...
+Defining \file_find:nN on line ...
+Defining \file_find:VN on line ...
+Defining \__file_find_search:N on line ...
 Defining \file_if_exist:nT on line ...
 Defining \file_if_exist:nF on line ...
 Defining \file_if_exist:nTF on line ...
+Defining \file_if_exist:nNT on line ...
+Defining \file_if_exist:nNF on line ...
+Defining \file_if_exist:nNTF on line ...
 Defining \file_input:n on line ...
-Defining \__file_if_exist:nT on line ...
+Defining \__file_missing:n on line ...
 Defining \__file_input:n on line ...
 Defining \__file_input:V on line ...
 Defining \__file_input_aux:n on line ...
 Defining \__file_input_aux:o on line ...
-Defining \file_path_include:n on line ...
-Defining \__file_path_include:n on line ...
-Defining \file_path_remove:n on line ...
 Defining \file_list: on line ...
 Defining \c_term_ior on line ...
 Defining \g__ior_streams_seq on line ...
@@ -2871,14 +2874,12 @@ Defining \ior_new:N on line ...
 Defining \ior_new:c on line ...
 Defining \ior_open:Nn on line ...
 Defining \ior_open:cn on line ...
-Defining \__ior_open_aux:Nn on line ...
 Defining \ior_open:NnT on line ...
 Defining \ior_open:NnF on line ...
 Defining \ior_open:NnTF on line ...
 Defining \ior_open:cnT on line ...
 Defining \ior_open:cnF on line ...
 Defining \ior_open:cnTF on line ...
-Defining \__ior_open_aux:NnTF on line ...
 Defining \__ior_new:N on line ...
 Defining \__ior_open:Nn on line ...
 Defining \__ior_open:No on line ...
@@ -2914,9 +2915,8 @@ Defining \iow_new:c on line ...
 Defining \__iow_new:N on line ...
 Defining \iow_open:Nn on line ...
 Defining \iow_open:cn on line ...
-Defining \__iow_open:Nn on line ...
-Defining \__iow_open:No on line ...
 Defining \__iow_open_stream:Nn on line ...
+Defining \__iow_open_stream:NV on line ...
 Defining \iow_close:N on line ...
 Defining \iow_close:c on line ...
 Defining \iow_list_streams: on line ...
@@ -2995,6 +2995,10 @@ Defining message LaTeX/kernel/input-streams-exhausted on line ...
 Defining message LaTeX/kernel/output-streams-exhausted on line ...
 Defining message LaTeX/kernel/unbalanced-quote-in-filename on line ...
 Defining message LaTeX/kernel/iow-indent on line ...
+Defining \g_file_current_name_tl on line ...
+Defining \file_path_include:n on line ...
+Defining \file_path_remove:n on line ...
+Defining \file_add_path:nN on line ...
 Defining \ior_get_str:NN on line ...
 Defining \if_dim:w on line ...
 Defining \__dim_eval:w on line ...
diff --git a/l3kernel/testfiles/m3expl003.ptex.tlg b/l3kernel/testfiles/m3expl003.ptex.tlg
index 595e527..ef1ce4b 100644
--- a/l3kernel/testfiles/m3expl003.ptex.tlg
+++ b/l3kernel/testfiles/m3expl003.ptex.tlg
@@ -2825,31 +2825,34 @@ Defining \__msg_show_wrap_aux:w on line ...
 Defining \__msg_show_item:n on line ...
 Defining \__msg_show_item:nn on line ...
 Defining \__msg_show_item_unbraced:nn on line ...
-Defining \g_file_current_name_tl on line ...
+Defining \g_file_current_name_str on line ...
 Defining \g__file_stack_seq on line ...
 Defining \g__file_record_seq on line ...
-Defining \l__file_internal_tl on line ...
-Defining \l__file_internal_name_tl on line ...
-Defining \l__file_search_path_seq on line ...
+Defining \l__file_tmp_tl on line ...
+Defining \l__file_name_str on line ...
+Defining \l__file_path_str on line ...
+Defining \l_file_search_path_seq on line ...
 Defining \l__file_saved_search_path_seq on line ...
-Defining \l__file_internal_seq on line ...
-Defining \__file_name_sanitize:nn on line ...
-Defining \__file_name_sanitize_aux:n on line ...
-Defining \file_add_path:nN on line ...
-Defining \__file_add_path:nN on line ...
-Defining \__file_add_path_search:nN on line ...
+Defining \l__file_tmp_seq on line ...
+Defining \__file_name_sanitize:nN on line ...
+Defining \__file_name_quote:nN on line ...
+Defining \__file_name_quote:VN on line ...
+Defining \__file_name_quote_aux:n on line ...
+Defining \file_find:nN on line ...
+Defining \file_find:VN on line ...
+Defining \__file_find_search:N on line ...
 Defining \file_if_exist:nT on line ...
 Defining \file_if_exist:nF on line ...
 Defining \file_if_exist:nTF on line ...
+Defining \file_if_exist:nNT on line ...
+Defining \file_if_exist:nNF on line ...
+Defining \file_if_exist:nNTF on line ...
 Defining \file_input:n on line ...
-Defining \__file_if_exist:nT on line ...
+Defining \__file_missing:n on line ...
 Defining \__file_input:n on line ...
 Defining \__file_input:V on line ...
 Defining \__file_input_aux:n on line ...
 Defining \__file_input_aux:o on line ...
-Defining \file_path_include:n on line ...
-Defining \__file_path_include:n on line ...
-Defining \file_path_remove:n on line ...
 Defining \file_list: on line ...
 Defining \c_term_ior on line ...
 Defining \g__ior_streams_seq on line ...
@@ -2859,14 +2862,12 @@ Defining \ior_new:N on line ...
 Defining \ior_new:c on line ...
 Defining \ior_open:Nn on line ...
 Defining \ior_open:cn on line ...
-Defining \__ior_open_aux:Nn on line ...
 Defining \ior_open:NnT on line ...
 Defining \ior_open:NnF on line ...
 Defining \ior_open:NnTF on line ...
 Defining \ior_open:cnT on line ...
 Defining \ior_open:cnF on line ...
 Defining \ior_open:cnTF on line ...
-Defining \__ior_open_aux:NnTF on line ...
 Defining \__ior_new:N on line ...
 Defining \__ior_open:Nn on line ...
 Defining \__ior_open:No on line ...
@@ -2902,9 +2903,8 @@ Defining \iow_new:c on line ...
 Defining \__iow_new:N on line ...
 Defining \iow_open:Nn on line ...
 Defining \iow_open:cn on line ...
-Defining \__iow_open:Nn on line ...
-Defining \__iow_open:No on line ...
 Defining \__iow_open_stream:Nn on line ...
+Defining \__iow_open_stream:NV on line ...
 Defining \iow_close:N on line ...
 Defining \iow_close:c on line ...
 Defining \iow_list_streams: on line ...
@@ -2983,6 +2983,10 @@ Defining message LaTeX/kernel/input-streams-exhausted on line ...
 Defining message LaTeX/kernel/output-streams-exhausted on line ...
 Defining message LaTeX/kernel/unbalanced-quote-in-filename on line ...
 Defining message LaTeX/kernel/iow-indent on line ...
+Defining \g_file_current_name_tl on line ...
+Defining \file_path_include:n on line ...
+Defining \file_path_remove:n on line ...
+Defining \file_add_path:nN on line ...
 Defining \ior_get_str:NN on line ...
 Defining \if_dim:w on line ...
 Defining \__dim_eval:w on line ...
diff --git a/l3kernel/testfiles/m3expl003.tlg b/l3kernel/testfiles/m3expl003.tlg
index 3af0465..05d4102 100644
--- a/l3kernel/testfiles/m3expl003.tlg
+++ b/l3kernel/testfiles/m3expl003.tlg
@@ -2825,31 +2825,34 @@ Defining \__msg_show_wrap_aux:w on line ...
 Defining \__msg_show_item:n on line ...
 Defining \__msg_show_item:nn on line ...
 Defining \__msg_show_item_unbraced:nn on line ...
-Defining \g_file_current_name_tl on line ...
+Defining \g_file_current_name_str on line ...
 Defining \g__file_stack_seq on line ...
 Defining \g__file_record_seq on line ...
-Defining \l__file_internal_tl on line ...
-Defining \l__file_internal_name_tl on line ...
-Defining \l__file_search_path_seq on line ...
+Defining \l__file_tmp_tl on line ...
+Defining \l__file_name_str on line ...
+Defining \l__file_path_str on line ...
+Defining \l_file_search_path_seq on line ...
 Defining \l__file_saved_search_path_seq on line ...
-Defining \l__file_internal_seq on line ...
-Defining \__file_name_sanitize:nn on line ...
-Defining \__file_name_sanitize_aux:n on line ...
-Defining \file_add_path:nN on line ...
-Defining \__file_add_path:nN on line ...
-Defining \__file_add_path_search:nN on line ...
+Defining \l__file_tmp_seq on line ...
+Defining \__file_name_sanitize:nN on line ...
+Defining \__file_name_quote:nN on line ...
+Defining \__file_name_quote:VN on line ...
+Defining \__file_name_quote_aux:n on line ...
+Defining \file_find:nN on line ...
+Defining \file_find:VN on line ...
+Defining \__file_find_search:N on line ...
 Defining \file_if_exist:nT on line ...
 Defining \file_if_exist:nF on line ...
 Defining \file_if_exist:nTF on line ...
+Defining \file_if_exist:nNT on line ...
+Defining \file_if_exist:nNF on line ...
+Defining \file_if_exist:nNTF on line ...
 Defining \file_input:n on line ...
-Defining \__file_if_exist:nT on line ...
+Defining \__file_missing:n on line ...
 Defining \__file_input:n on line ...
 Defining \__file_input:V on line ...
 Defining \__file_input_aux:n on line ...
 Defining \__file_input_aux:o on line ...
-Defining \file_path_include:n on line ...
-Defining \__file_path_include:n on line ...
-Defining \file_path_remove:n on line ...
 Defining \file_list: on line ...
 Defining \c_term_ior on line ...
 Defining \g__ior_streams_seq on line ...
@@ -2859,14 +2862,12 @@ Defining \ior_new:N on line ...
 Defining \ior_new:c on line ...
 Defining \ior_open:Nn on line ...
 Defining \ior_open:cn on line ...
-Defining \__ior_open_aux:Nn on line ...
 Defining \ior_open:NnT on line ...
 Defining \ior_open:NnF on line ...
 Defining \ior_open:NnTF on line ...
 Defining \ior_open:cnT on line ...
 Defining \ior_open:cnF on line ...
 Defining \ior_open:cnTF on line ...
-Defining \__ior_open_aux:NnTF on line ...
 Defining \__ior_new:N on line ...
 Defining \__ior_open:Nn on line ...
 Defining \__ior_open:No on line ...
@@ -2902,9 +2903,8 @@ Defining \iow_new:c on line ...
 Defining \__iow_new:N on line ...
 Defining \iow_open:Nn on line ...
 Defining \iow_open:cn on line ...
-Defining \__iow_open:Nn on line ...
-Defining \__iow_open:No on line ...
 Defining \__iow_open_stream:Nn on line ...
+Defining \__iow_open_stream:NV on line ...
 Defining \iow_close:N on line ...
 Defining \iow_close:c on line ...
 Defining \iow_list_streams: on line ...
@@ -2983,6 +2983,10 @@ Defining message LaTeX/kernel/input-streams-exhausted on line ...
 Defining message LaTeX/kernel/output-streams-exhausted on line ...
 Defining message LaTeX/kernel/unbalanced-quote-in-filename on line ...
 Defining message LaTeX/kernel/iow-indent on line ...
+Defining \g_file_current_name_tl on line ...
+Defining \file_path_include:n on line ...
+Defining \file_path_remove:n on line ...
+Defining \file_add_path:nN on line ...
 Defining \ior_get_str:NN on line ...
 Defining \if_dim:w on line ...
 Defining \__dim_eval:w on line ...
diff --git a/l3kernel/testfiles/m3expl003.uptex.tlg b/l3kernel/testfiles/m3expl003.uptex.tlg
index 05c164a..dd29e16 100644
--- a/l3kernel/testfiles/m3expl003.uptex.tlg
+++ b/l3kernel/testfiles/m3expl003.uptex.tlg
@@ -2825,31 +2825,34 @@ Defining \__msg_show_wrap_aux:w on line ...
 Defining \__msg_show_item:n on line ...
 Defining \__msg_show_item:nn on line ...
 Defining \__msg_show_item_unbraced:nn on line ...
-Defining \g_file_current_name_tl on line ...
+Defining \g_file_current_name_str on line ...
 Defining \g__file_stack_seq on line ...
 Defining \g__file_record_seq on line ...
-Defining \l__file_internal_tl on line ...
-Defining \l__file_internal_name_tl on line ...
-Defining \l__file_search_path_seq on line ...
+Defining \l__file_tmp_tl on line ...
+Defining \l__file_name_str on line ...
+Defining \l__file_path_str on line ...
+Defining \l_file_search_path_seq on line ...
 Defining \l__file_saved_search_path_seq on line ...
-Defining \l__file_internal_seq on line ...
-Defining \__file_name_sanitize:nn on line ...
-Defining \__file_name_sanitize_aux:n on line ...
-Defining \file_add_path:nN on line ...
-Defining \__file_add_path:nN on line ...
-Defining \__file_add_path_search:nN on line ...
+Defining \l__file_tmp_seq on line ...
+Defining \__file_name_sanitize:nN on line ...
+Defining \__file_name_quote:nN on line ...
+Defining \__file_name_quote:VN on line ...
+Defining \__file_name_quote_aux:n on line ...
+Defining \file_find:nN on line ...
+Defining \file_find:VN on line ...
+Defining \__file_find_search:N on line ...
 Defining \file_if_exist:nT on line ...
 Defining \file_if_exist:nF on line ...
 Defining \file_if_exist:nTF on line ...
+Defining \file_if_exist:nNT on line ...
+Defining \file_if_exist:nNF on line ...
+Defining \file_if_exist:nNTF on line ...
 Defining \file_input:n on line ...
-Defining \__file_if_exist:nT on line ...
+Defining \__file_missing:n on line ...
 Defining \__file_input:n on line ...
 Defining \__file_input:V on line ...
 Defining \__file_input_aux:n on line ...
 Defining \__file_input_aux:o on line ...
-Defining \file_path_include:n on line ...
-Defining \__file_path_include:n on line ...
-Defining \file_path_remove:n on line ...
 Defining \file_list: on line ...
 Defining \c_term_ior on line ...
 Defining \g__ior_streams_seq on line ...
@@ -2859,14 +2862,12 @@ Defining \ior_new:N on line ...
 Defining \ior_new:c on line ...
 Defining \ior_open:Nn on line ...
 Defining \ior_open:cn on line ...
-Defining \__ior_open_aux:Nn on line ...
 Defining \ior_open:NnT on line ...
 Defining \ior_open:NnF on line ...
 Defining \ior_open:NnTF on line ...
 Defining \ior_open:cnT on line ...
 Defining \ior_open:cnF on line ...
 Defining \ior_open:cnTF on line ...
-Defining \__ior_open_aux:NnTF on line ...
 Defining \__ior_new:N on line ...
 Defining \__ior_open:Nn on line ...
 Defining \__ior_open:No on line ...
@@ -2902,9 +2903,8 @@ Defining \iow_new:c on line ...
 Defining \__iow_new:N on line ...
 Defining \iow_open:Nn on line ...
 Defining \iow_open:cn on line ...
-Defining \__iow_open:Nn on line ...
-Defining \__iow_open:No on line ...
 Defining \__iow_open_stream:Nn on line ...
+Defining \__iow_open_stream:NV on line ...
 Defining \iow_close:N on line ...
 Defining \iow_close:c on line ...
 Defining \iow_list_streams: on line ...
@@ -2983,6 +2983,10 @@ Defining message LaTeX/kernel/input-streams-exhausted on line ...
 Defining message LaTeX/kernel/output-streams-exhausted on line ...
 Defining message LaTeX/kernel/unbalanced-quote-in-filename on line ...
 Defining message LaTeX/kernel/iow-indent on line ...
+Defining \g_file_current_name_tl on line ...
+Defining \file_path_include:n on line ...
+Defining \file_path_remove:n on line ...
+Defining \file_add_path:nN on line ...
 Defining \ior_get_str:NN on line ...
 Defining \if_dim:w on line ...
 Defining \__dim_eval:w on line ...
diff --git a/l3kernel/testfiles/m3expl003.xetex.tlg b/l3kernel/testfiles/m3expl003.xetex.tlg
index 1b5ab82..61ffe0e 100644
--- a/l3kernel/testfiles/m3expl003.xetex.tlg
+++ b/l3kernel/testfiles/m3expl003.xetex.tlg
@@ -2835,31 +2835,34 @@ Defining \__msg_show_wrap_aux:w on line ...
 Defining \__msg_show_item:n on line ...
 Defining \__msg_show_item:nn on line ...
 Defining \__msg_show_item_unbraced:nn on line ...
-Defining \g_file_current_name_tl on line ...
+Defining \g_file_current_name_str on line ...
 Defining \g__file_stack_seq on line ...
 Defining \g__file_record_seq on line ...
-Defining \l__file_internal_tl on line ...
-Defining \l__file_internal_name_tl on line ...
-Defining \l__file_search_path_seq on line ...
+Defining \l__file_tmp_tl on line ...
+Defining \l__file_name_str on line ...
+Defining \l__file_path_str on line ...
+Defining \l_file_search_path_seq on line ...
 Defining \l__file_saved_search_path_seq on line ...
-Defining \l__file_internal_seq on line ...
-Defining \__file_name_sanitize:nn on line ...
-Defining \__file_name_sanitize_aux:n on line ...
-Defining \file_add_path:nN on line ...
-Defining \__file_add_path:nN on line ...
-Defining \__file_add_path_search:nN on line ...
+Defining \l__file_tmp_seq on line ...
+Defining \__file_name_sanitize:nN on line ...
+Defining \__file_name_quote:nN on line ...
+Defining \__file_name_quote:VN on line ...
+Defining \__file_name_quote_aux:n on line ...
+Defining \file_find:nN on line ...
+Defining \file_find:VN on line ...
+Defining \__file_find_search:N on line ...
 Defining \file_if_exist:nT on line ...
 Defining \file_if_exist:nF on line ...
 Defining \file_if_exist:nTF on line ...
+Defining \file_if_exist:nNT on line ...
+Defining \file_if_exist:nNF on line ...
+Defining \file_if_exist:nNTF on line ...
 Defining \file_input:n on line ...
-Defining \__file_if_exist:nT on line ...
+Defining \__file_missing:n on line ...
 Defining \__file_input:n on line ...
 Defining \__file_input:V on line ...
 Defining \__file_input_aux:n on line ...
 Defining \__file_input_aux:o on line ...
-Defining \file_path_include:n on line ...
-Defining \__file_path_include:n on line ...
-Defining \file_path_remove:n on line ...
 Defining \file_list: on line ...
 Defining \c_term_ior on line ...
 Defining \g__ior_streams_seq on line ...
@@ -2869,14 +2872,12 @@ Defining \ior_new:N on line ...
 Defining \ior_new:c on line ...
 Defining \ior_open:Nn on line ...
 Defining \ior_open:cn on line ...
-Defining \__ior_open_aux:Nn on line ...
 Defining \ior_open:NnT on line ...
 Defining \ior_open:NnF on line ...
 Defining \ior_open:NnTF on line ...
 Defining \ior_open:cnT on line ...
 Defining \ior_open:cnF on line ...
 Defining \ior_open:cnTF on line ...
-Defining \__ior_open_aux:NnTF on line ...
 Defining \__ior_new:N on line ...
 Defining \__ior_open:Nn on line ...
 Defining \__ior_open:No on line ...
@@ -2912,9 +2913,8 @@ Defining \iow_new:c on line ...
 Defining \__iow_new:N on line ...
 Defining \iow_open:Nn on line ...
 Defining \iow_open:cn on line ...
-Defining \__iow_open:Nn on line ...
-Defining \__iow_open:No on line ...
 Defining \__iow_open_stream:Nn on line ...
+Defining \__iow_open_stream:NV on line ...
 Defining \iow_close:N on line ...
 Defining \iow_close:c on line ...
 Defining \iow_list_streams: on line ...
@@ -2993,6 +2993,10 @@ Defining message LaTeX/kernel/input-streams-exhausted on line ...
 Defining message LaTeX/kernel/output-streams-exhausted on line ...
 Defining message LaTeX/kernel/unbalanced-quote-in-filename on line ...
 Defining message LaTeX/kernel/iow-indent on line ...
+Defining \g_file_current_name_tl on line ...
+Defining \file_path_include:n on line ...
+Defining \file_path_remove:n on line ...
+Defining \file_add_path:nN on line ...
 Defining \ior_get_str:NN on line ...
 Defining \if_dim:w on line ...
 Defining \__dim_eval:w on line ...
diff --git a/l3kernel/testfiles/m3file001.lvt b/l3kernel/testfiles/m3file001.lvt
index 64f32fe..22fc9ec 100644
--- a/l3kernel/testfiles/m3file001.lvt
+++ b/l3kernel/testfiles/m3file001.lvt
@@ -43,13 +43,13 @@
   }
 
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-\TEST { Add~path~to~file }
+\TEST { Finding~files }
   {
-    \file_add_path:nN { filetest.txt } \l_A_tl
+    \file_find:nN { filetest.txt } \l_A_tl
     \tl_log:N \l_A_tl
-    \file_add_path:nN { \filea } \l_A_tl
+    \file_find:nN { \filea } \l_A_tl
     \tl_log:N \l_A_tl
-    \file_add_path:nN { NotAFile.xxx.yyy.zzz } \l_A_tl
+    \file_find:nN { NotAFile.xxx.yyy.zzz } \l_A_tl
     \tl_log:N \l_A_tl
   }
 
@@ -82,12 +82,18 @@
 
 \TEST { File~name~quoting }
   {
-    \__file_name_sanitize:nn { foo.bar }     { \tl_log:n }
-    \__file_name_sanitize:nn { "foo.bar" }   { \tl_log:n }
-    \__file_name_sanitize:nn { "foo."bar"" } { \tl_log:n }
-    \__file_name_sanitize:nn { "foo."bar" }  { \tl_log:n }
-    \__file_name_sanitize:nn { foo~.bar }    { \tl_log:n }
-    \__file_name_sanitize:nn { "foo~.bar" }  { \tl_log:n }
+    \__file_name_quote:nN { foo.bar }     \l_tmpa_str
+    \tl_show:N \l_tmpa_str
+    \__file_name_quote:nN { "foo.bar" }   \l_tmpa_str
+    \tl_show:N \l_tmpa_str
+    \__file_name_quote:nN { "foo."bar"" } \l_tmpa_str
+    \tl_show:N \l_tmpa_str
+    \__file_name_quote:nN { "foo."bar" }  \l_tmpa_str
+    \tl_show:N \l_tmpa_str
+    \__file_name_quote:nN { foo~.bar }    \l_tmpa_str
+    \tl_show:N \l_tmpa_str
+    \__file_name_quote:nN { "foo~.bar" }  \l_tmpa_str
+    \tl_show:N \l_tmpa_str
   }
 
 \END
diff --git a/l3kernel/testfiles/m3file001.ptex.tlg b/l3kernel/testfiles/m3file001.ptex.tlg
index b9cf9a3..8a7480f 100644
--- a/l3kernel/testfiles/m3file001.ptex.tlg
+++ b/l3kernel/testfiles/m3file001.ptex.tlg
@@ -15,11 +15,11 @@ FALSE
 FALSE
 ============================================================
 ============================================================
-TEST 2: Add path to file
+TEST 2: Finding files
 ============================================================
 > \l_A_tl=filetest.txt.
 > \l_A_tl=filetest.txt.
-> \l_A_tl=\q_no_value .
+> \l_A_tl=.
 ============================================================
 ============================================================
 TEST 3: Loading a file
@@ -91,9 +91,15 @@ filetest.txt
 ============================================================
 TEST 6: File name quoting
 ============================================================
-> foo.bar.
-> foo.bar.
-> foo.bar.
+> \l_tmpa_str=foo.bar.
+<recently read> }
+l. ...  }
+> \l_tmpa_str=foo.bar.
+<recently read> }
+l. ...  }
+> \l_tmpa_str=foo.bar.
+<recently read> }
+l. ...  }
 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 !
 ! LaTeX error: "kernel/unbalanced-quote-in-filename"
@@ -108,7 +114,13 @@ l. ...  }
 |'''''''''''''''''''''''''''''''''''''''''''''''
 | File names must contain balanced numbers of quotes (").
 |...............................................
-> "foo."bar".
-> "foo .bar".
-> "foo .bar".
+> \l_tmpa_str="foo."bar".
+<recently read> }
+l. ...  }
+> \l_tmpa_str="foo .bar".
+<recently read> }
+l. ...  }
+> \l_tmpa_str="foo .bar".
+<recently read> }
+l. ...  }
 ============================================================
diff --git a/l3kernel/testfiles/m3file001.tlg b/l3kernel/testfiles/m3file001.tlg
index c673e0a..eae443d 100644
--- a/l3kernel/testfiles/m3file001.tlg
+++ b/l3kernel/testfiles/m3file001.tlg
@@ -15,11 +15,11 @@ FALSE
 FALSE
 ============================================================
 ============================================================
-TEST 2: Add path to file
+TEST 2: Finding files
 ============================================================
 > \l_A_tl=filetest.txt.
 > \l_A_tl=filetest.txt.
-> \l_A_tl=\q_no_value .
+> \l_A_tl=.
 ============================================================
 ============================================================
 TEST 3: Loading a file
@@ -85,9 +85,15 @@ filetest.txt
 ============================================================
 TEST 6: File name quoting
 ============================================================
-> foo.bar.
-> foo.bar.
-> foo.bar.
+> \l_tmpa_str=foo.bar.
+<recently read> }
+l. ...  }
+> \l_tmpa_str=foo.bar.
+<recently read> }
+l. ...  }
+> \l_tmpa_str=foo.bar.
+<recently read> }
+l. ...  }
 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 !
 ! LaTeX error: "kernel/unbalanced-quote-in-filename"
@@ -102,7 +108,13 @@ l. ...  }
 |'''''''''''''''''''''''''''''''''''''''''''''''
 | File names must contain balanced numbers of quotes (").
 |...............................................
-> "foo."bar".
-> "foo .bar".
-> "foo .bar".
+> \l_tmpa_str="foo."bar".
+<recently read> }
+l. ...  }
+> \l_tmpa_str="foo .bar".
+<recently read> }
+l. ...  }
+> \l_tmpa_str="foo .bar".
+<recently read> }
+l. ...  }
 ============================================================
diff --git a/l3kernel/testfiles/m3file001.uptex.tlg b/l3kernel/testfiles/m3file001.uptex.tlg
index e668387..d744ba7 100644
--- a/l3kernel/testfiles/m3file001.uptex.tlg
+++ b/l3kernel/testfiles/m3file001.uptex.tlg
@@ -15,11 +15,11 @@ FALSE
 FALSE
 ============================================================
 ============================================================
-TEST 2: Add path to file
+TEST 2: Finding files
 ============================================================
 > \l_A_tl=filetest.txt.
 > \l_A_tl=filetest.txt.
-> \l_A_tl=\q_no_value .
+> \l_A_tl=.
 ============================================================
 ============================================================
 TEST 3: Loading a file
@@ -91,9 +91,15 @@ filetest.txt
 ============================================================
 TEST 6: File name quoting
 ============================================================
-> foo.bar.
-> foo.bar.
-> foo.bar.
+> \l_tmpa_str=foo.bar.
+<recently read> }
+l. ...  }
+> \l_tmpa_str=foo.bar.
+<recently read> }
+l. ...  }
+> \l_tmpa_str=foo.bar.
+<recently read> }
+l. ...  }
 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 !
 ! LaTeX error: "kernel/unbalanced-quote-in-filename"
@@ -108,7 +114,13 @@ l. ...  }
 |'''''''''''''''''''''''''''''''''''''''''''''''
 | File names must contain balanced numbers of quotes (").
 |...............................................
-> "foo."bar".
-> "foo .bar".
-> "foo .bar".
+> \l_tmpa_str="foo."bar".
+<recently read> }
+l. ...  }
+> \l_tmpa_str="foo .bar".
+<recently read> }
+l. ...  }
+> \l_tmpa_str="foo .bar".
+<recently read> }
+l. ...  }
 ============================================================
diff --git a/l3kernel/testfiles/m3file001.xetex.tlg b/l3kernel/testfiles/m3file001.xetex.tlg
index 622968d..ca619be 100644
--- a/l3kernel/testfiles/m3file001.xetex.tlg
+++ b/l3kernel/testfiles/m3file001.xetex.tlg
@@ -15,11 +15,11 @@ FALSE
 FALSE
 ============================================================
 ============================================================
-TEST 2: Add path to file
+TEST 2: Finding files
 ============================================================
 > \l_A_tl=filetest.txt.
 > \l_A_tl=filetest.txt.
-> \l_A_tl=\q_no_value .
+> \l_A_tl=.
 ============================================================
 ============================================================
 TEST 3: Loading a file
@@ -85,9 +85,15 @@ filetest.txt
 ============================================================
 TEST 6: File name quoting
 ============================================================
-> foo.bar.
-> foo.bar.
-> foo.bar.
+> \l_tmpa_str=foo.bar.
+<recently read> }
+l. ...  }
+> \l_tmpa_str=foo.bar.
+<recently read> }
+l. ...  }
+> \l_tmpa_str=foo.bar.
+<recently read> }
+l. ...  }
 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 !
 ! LaTeX error: "kernel/unbalanced-quote-in-filename"
@@ -102,7 +108,13 @@ l. ...  }
 |'''''''''''''''''''''''''''''''''''''''''''''''
 | File names must contain balanced numbers of quotes (").
 |...............................................
-> "foo."bar".
-> "foo .bar".
-> "foo .bar".
+> \l_tmpa_str="foo."bar".
+<recently read> }
+l. ...  }
+> \l_tmpa_str="foo .bar".
+<recently read> }
+l. ...  }
+> \l_tmpa_str="foo .bar".
+<recently read> }
+l. ...  }
 ============================================================

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the latex3-commits mailing list