Skip to content

luamplib creates unexpected files #106

@Reissner

Description

@Reissner

I compile the following file test.tex

\documentclass{article}
\usepackage{fontspec}
\usepackage{luamplib}

\begin{document}
  
\begin{mplibcode}
input metauml;
beginfig(1);
  Note.xxx("Hello");
  drawObjects(xxx);
  endfig;
  end
bye
\end{mplibcode}
\end{document}

with lualatex -recorder test. The problem occurs also with no recorder option.
What I face are a lot of files in the local folder all of the form luamplib_input_metauml*_mp but all empty.

When I open test.fls then I observe lines like the following:

INPUT /usr/share/texmf/metapost/metauml/metauml.mp
OUTPUT                 ./luamplib_input_metauml_mp
...
INPUT /usr/share/texmf/metapost/metauml/util_object.mp
OUTPUT                 ./luamplib_input_util_object_mp

This seems part of the explanation: lualatex seems to load several files tied with metauml but no idea why it writes those mysterious files.

Some hint is in the luamplib documentation: from the documentation

local function replaceinputmpfile (name,file)
167 local ofmodify = lfsattributes(file,”modification”)
168 if not ofmodify then return file end
169 local cachedir = luamplib.cachedir or outputdir
170 local newfile = name:gsub(”%W”,”_”)
171 newfile = cachedir ..”/luamplib_input_”..newfile   <-----------
172 if newfile and luamplibtime then
173 local nf = lfsattributes(newfile)
174 if nf and nf.mode == ”file” and
175 ofmodify == nf.modification and luamplibtime < nf.access then
176 return nf.size == 0 and file or newfile
177 end
178 end

I think this could be lua... can anyone tell me what happens here and how can I avoid these files in the local directory?

Thanks in advance.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions