summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/l3kernel/l3file.dtx
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2023-05-17 03:01:58 +0000
committerNorbert Preining <norbert@preining.info>2023-05-17 03:01:58 +0000
commit92ffb9032b85f818a8d3b469ad4d3889c2a44ba1 (patch)
tree54bc1ce009357117a376baa5ffa223f904acee4f /macros/latex/contrib/l3kernel/l3file.dtx
parent95bdae3d8a40af1f2f82f786dc29d3761fe431f1 (diff)
CTAN sync 202305170301
Diffstat (limited to 'macros/latex/contrib/l3kernel/l3file.dtx')
-rw-r--r--macros/latex/contrib/l3kernel/l3file.dtx125
1 files changed, 8 insertions, 117 deletions
diff --git a/macros/latex/contrib/l3kernel/l3file.dtx b/macros/latex/contrib/l3kernel/l3file.dtx
index c5e7fc1df7..4be6f56f80 100644
--- a/macros/latex/contrib/l3kernel/l3file.dtx
+++ b/macros/latex/contrib/l3kernel/l3file.dtx
@@ -44,7 +44,7 @@
% }^^A
% }
%
-% \date{Released 2023-05-11}
+% \date{Released 2023-05-15}
%
% \maketitle
%
@@ -2817,7 +2817,7 @@
%
% \begin{macro}[EXP]{\file_full_name:n, \@@_full_name:n, \@@_full_name_aux:n}
% \begin{macro}[EXP]{\@@_full_name_auxi:nn, \@@_full_name_auxii:nn}
-% \begin{macro}[EXP]{\@@_full_name_aux:Nnn}
+% \begin{macro}[EXP]{\@@_full_name_aux:Nnnn}
% \begin{macro}[EXP]{\@@_full_name_aux:nN}
% \begin{macro}[EXP]{\@@_full_name_aux:nnN}
% \begin{macro}[EXP]{\@@_name_cleanup:w}
@@ -2887,11 +2887,11 @@
\tl_if_blank:nTF {#2}
{
\seq_map_tokens:Nn \l_file_search_path_seq
- { \@@_full_name_aux:Nnn \seq_map_break:n {#1} }
+ { \@@_full_name_aux:Nnnn \seq_map_break:n {#1} { / } }
\cs_if_exist:NT \input@path
{
\tl_map_tokens:Nn \input@path
- { \@@_full_name_aux:Nnn \tl_map_break:n {#1} }
+ { \@@_full_name_aux:Nnnn \tl_map_break:n {#1} { } }
}
\@@_name_end:
}
@@ -2901,8 +2901,8 @@
% Two pars to the auxiliary here so we can avoid doing quoting
% twice in the event we find the right file.
% \begin{macrocode}
-\cs_new:Npn \@@_full_name_aux:Nnn #1#2#3
- { \exp_args:Ne \@@_full_name_aux:nN { \tl_to_str:n {#3} / #2 } #1 }
+\cs_new:Npn \@@_full_name_aux:Nnnn #1#2#3#4
+ { \exp_args:Ne \@@_full_name_aux:nN { \tl_to_str:n {#4} #3 #2 } #1 }
\cs_new:Npn \@@_full_name_aux:nN #1
{ \exp_args:Nne \@@_full_name_aux:nnN {#1} { \@@_full_name_aux:n {#1} } }
\cs_new:Npn \@@_full_name_aux:nnN #1 #2 #3
@@ -2958,24 +2958,6 @@
}
}
% \end{macrocode}
-% Deal with the fact that the primitive might not be available.
-% \begin{macrocode}
-\cs_if_exist:NF \tex_filesize:D
- {
- \cs_gset:Npn \file_full_name:n #1
- {
- \msg_expandable_error:nnn
- { kernel } { primitive-not-available }
- { \(pdf)filesize }
- }
- }
-\msg_new:nnnn { kernel } { primitive-not-available }
- { Primitive~\token_to_str:N #1 not~available }
- {
- The~version~of~your~TeX~engine~does~not~provide~functionality~equivalent~to~
- the~#1~primitive.
- }
-% \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
@@ -3014,68 +2996,12 @@
\cs_generate_variant:Nn \file_get_full_name:nNF { V }
\cs_generate_variant:Nn \file_get_full_name:nNTF { V }
% \end{macrocode}
-% If \cs{tex_filesize:D} is not available, the
-% way to test if a file exists is to try to open it: if it does
-% not exist then \TeX{} reports end-of-file. A search is made
-% looking at each potential path in turn (starting from the current
-% directory). The first location is of course treated as the correct
-% one: this is done by jumping to \cs{prg_break_point:}. If nothing
-% is found, |#2| is returned empty. A special case when there is no
-% extension is that once the first location is found we test the
-% existence of the file with |.tex| extension in that directory, and
-% if it exists we include the |.tex| extension in the result.
-% \begin{macrocode}
-\cs_if_exist:NF \tex_filesize:D
- {
- \prg_set_protected_conditional:Npnn \file_get_full_name:nN #1#2 { T , F , TF }
- {
- \__kernel_tl_set:Nx \l_@@_base_name_tl
- { \__kernel_file_name_sanitize:n {#1} }
- \@@_get_full_name_search:nN { } \use:n
- \seq_map_inline:Nn \l_file_search_path_seq
- { \@@_get_full_name_search:nN { ##1 / } \seq_map_break:n }
- \cs_if_exist:NT \input@path
- {
- \tl_map_inline:Nn \input@path
- { \@@_get_full_name_search:nN { ##1 } \tl_map_break:n }
- }
- \tl_set:Nn \l_@@_full_name_tl { \q_no_value }
- \prg_break_point:
- \quark_if_no_value:NTF \l_@@_full_name_tl
- {
- \ior_close:N \g_@@_internal_ior
- \prg_return_false:
- }
- {
- \file_parse_full_name:VNNN \l_@@_full_name_tl
- \l_@@_dir_str \l_@@_name_str \l_@@_ext_str
- \str_if_empty:NT \l_@@_ext_str
- {
- \__kernel_ior_open:No \g_@@_internal_ior
- { \l_@@_full_name_tl .tex }
- \ior_if_eof:NF \g_@@_internal_ior
- { \tl_put_right:Nn \l_@@_full_name_tl { .tex } }
- }
- \ior_close:N \g_@@_internal_ior
- \tl_set_eq:NN #2 \l_@@_full_name_tl
- \prg_return_true:
- }
- }
- }
-\cs_new_protected:Npn \@@_get_full_name_search:nN #1#2
- {
- \__kernel_tl_set:Nx \l_@@_full_name_tl
- { \tl_to_str:n {#1} \l_@@_base_name_tl }
- \__kernel_ior_open:No \g_@@_internal_ior \l_@@_full_name_tl
- \ior_if_eof:NF \g_@@_internal_ior { #2 { \prg_break: } }
- }
-% \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
+%
% \begin{variable}{\g_@@_internal_ior}
-% A reserved stream to test for file existence (if required), and for
-% opening a shell.
+% A reserved stream to test for opening a shell.
% \begin{macrocode}
\ior_new:N \g_@@_internal_ior
% \end{macrocode}
@@ -3226,30 +3152,6 @@
{ \prg_return_true: }
}
% \end{macrocode}
-% Where the primitive is not available, issue an error: this is a little
-% more conservative than absolutely needed, but does work.
-% \begin{macrocode}
-\cs_if_exist:NF \tex_filesize:D
- {
- \cs_set_protected:Npn \@@_get_details:nnN #1#2#3
- {
- \tl_clear:N #3
- \msg_error:nnx
- { kernel } { primitive-not-available }
- {
- \token_to_str:N \(pdf)file
- \str_case:nn {#2}
- {
- { hex_dump } { dump }
- { mdfive_hash } { mdfivesum }
- { timestamp } { moddate }
- { size } { size }
- }
- }
- \prg_return_false:
- }
- }
-% \end{macrocode}
% \end{macro}
% \end{macro}
%
@@ -3328,17 +3230,6 @@
}
}
\cs_new_eq:NN \@@_timestamp:n \tex_filemoddate:D
-\cs_if_exist:NF \@@_timestamp:n
- {
- \prg_set_conditional:Npnn \file_compare_timestamp:nNn #1#2#3
- { p , T , F , TF }
- {
- \msg_expandable_error:nnn
- { kernel } { primitive-not-available }
- { \(pdf)filemoddate }
- \prg_return_false:
- }
- }
% \end{macrocode}
% \end{macro}
% \end{macro}