For the new version of my package and class standalone
I like to call external programs: further (pdf)latex
runs to optionally compile included standalone
files, and to convert the resulting PDF to PNG (depends on the fact that the PDF created by the last run isn't overwritten at least until \begin{document}
or until the first page is flushed out).
I know of course this can be done using \immediate\write18{<command> <arguments>}
which requires the command to be either added to the shell_escape_commands
variable of texmf.cnf
and shell_escape
to be set to p
or that the user uses the -shell-escape
argument.
Now I like to test in my code if the write18
call was successfully, i.e. if it was allowed to be executed. I know that \ifeof18
will return false if the write18
feature is completely disabled (shell_escape = 0
in texmf.cnf
or when the -no-shell-escape
argument is used), but it returns true if the restricted write18
mode is activated which is the default.
Is there a way to test if the last write18 call was blocked? (I know that I can test manually if the file which should be produced by the write18
call was created or updated.)
Update
In the .log
file there its one of the following lines displayed for every write18 call, depending if this feature is disabled, enabled or running in restricted mode with the command allowed or not, respectively:
runsystem(<command>)...disabled.
runsystem(<command>)...executed.
runsystem(<command>)...executed safely (allowed).
runsystem(<command>)...disabled (restricted).
So how can I get this information inside the LaTeX file (without actually reading the .log
file in)?