diff options
Diffstat (limited to 'Master/texmf-dist/source/latex/l3kernel/l3file.dtx')
-rw-r--r-- | Master/texmf-dist/source/latex/l3kernel/l3file.dtx | 34 |
1 files changed, 33 insertions, 1 deletions
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3file.dtx b/Master/texmf-dist/source/latex/l3kernel/l3file.dtx index 4cf93f65f5e..43e0cd1b7a8 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3file.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3file.dtx @@ -44,7 +44,7 @@ % }^^A % } % -% \date{Released 2024-12-09} +% \date{Released 2024-12-25} % % \maketitle % @@ -722,6 +722,29 @@ % searches for this string using the current \TeX{} search % path and the additional paths controlled by % \cs{l_file_search_path_seq}. +% +% Since \TeX{} cannot remove files, only write to them, once a file +% has been found during a \TeX{} run, it will exist until the end of +% the run unless a non-\TeX{} process intervenes. Since file operations +% are relatively slow, \pkg{expl3} therefore internally tracks when a +% file is seen, and uses this information to avoid multiple filesystem +% checks. See \cs{file_forget:n} for how to indicate to \pkg{expl3} that +% a file may have been deleted \emph{during} a \TeX{} run, so that its +% presence in the filesystem can be reasserted with \cs{file_if_exist:nTF} +% and similar commands. +% \end{function} +% +% \begin{function}[added = 2024-12-09]{\file_forget:n} +% \begin{syntax} +% \cs{file_forget:n} \Arg{file name} +% \end{syntax} +% Resets the internal tracker for files such that a subsequent use of +% \cs{file_if_exist:nTF}, \cs{file_size:n}, etc., for the \meta{file name} will +% re-query the filesystem rather than use any cached information. This can +% be used whether or not the file has previously been seen. This function +% is intended to be used where non-\TeX{} processes may result in file +% deletion, for example if \LuaTeX{} is in use, |os.remove()| may be used +% to delete a file part-way through a run. % \end{function} % % \subsection{Information about files and file contents} @@ -3120,6 +3143,15 @@ % \end{macro} % \end{macro} % +% \begin{macro}{\file_forget:n} +% Just a wrapper around a csname: we have to do a lookup here to make +% sure any paths are handled. +% \begin{macrocode} +\cs_new_protected:Npn \file_forget:n #1 + { \cs_undefine:c { @@_seen_ \file_full_name:n {#1} : } } +% \end{macrocode} +% \end{macro} +% % \begin{macro}{\file_get_full_name:nN, \file_get_full_name:VN} % \begin{macro}[TF]{\file_get_full_name:nN, \file_get_full_name:VN} % \begin{macro}{\@@_get_full_name_search:nN} |