#2278 texify with --tex-option="-job-name=Renamed" yields Windows API errors

open
nobody
None
2014-09-03
2013-07-15
Ulrich D i e z
No

I use texify (MiKTeX 2.9) under Windows 7 for compiling LaTeX2e-files to pdf-files.

With texify you can use the option --tex-option in order to pass options to the tex-compiler.

When you use --tex-option in order to provide another jobname in order to have those files created with another name that come into being during compilation [ auxiliary-files (.log /.aux) and output-files (.pdf/.dvi) ], then you get a bunch of Windows API-error-messages.

When saving the following code-snippet as "Example.tex"

% File: Example.tex
%
% texify
% --verbose
% --pdf
% --tex-option="-job-name=Renamed"
% Example.tex
%
\documentclass[a4paper]{article}%
\begin{document}%
\tableofcontents
\section{One}
\section{two}
\section{three}
text text
\end{document}%

, then typing at the command-line

texify --verbose --pdf --tex-option="-job-name=Renamed" Example.tex

yields the following console/screen-output:

| Microsoft Windows [Version 6.1.7601]
| Copyright (c) 2009 Microsoft Corporation. Alle Rechte vorbehalten.
|
| C:\Users\UD\Desktop>texify --verbose --pdf --tex-option="-job-name=Renamed" Exampl
| e.tex
| Processing Example.tex...
| Running pdflatex -job-name=Renamed C:/Users/UD/Desktop\Example.tex...
| This is pdfTeX, Version 3.1415926-2.4-1.40.13 (MiKTeX 2.9 64-bit)
| entering extended mode
| (C:/Users/UD/Desktop/Example.tex
| LaTeX2e <2011/06/27>
| Babel <v3.8m> and hyphenation patterns for english, afrikaans, ancientgreek, ar
| abic, armenian, assamese, basque, bengali, bokmal, bulgarian, catalan, coptic,
| croatian, czech, danish, dutch, esperanto, estonian, farsi, finnish, french, ga
| lician, german, german-x-2012-05-30, greek, gujarati, hindi, hungarian, iceland
| ic, indonesian, interlingua, irish, italian, kannada, kurmanji, latin, latvian,
| lithuanian, malayalam, marathi, mongolian, mongolianlmc, monogreek, ngerman, n
| german-x-2012-05-30, nynorsk, oriya, panjabi, pinyin, polish, portuguese, roman
| ian, russian, sanskrit, serbian, slovak, slovenian, spanish, swedish, swissgerm
| an, tamil, telugu, turkish, turkmen, ukenglish, ukrainian, uppersorbian, usengl
| ishmax, welsh, loaded.
| ("C:\Program Files\MiKTeX 2.9\tex\latex\base\article.cls"
| Document Class: article 2007/10/19 v1.4h Standard LaTeX document class
| ("C:\Program Files\MiKTeX 2.9\tex\latex\base\size10.clo"))
| No file Renamed.aux.
| No file Renamed.toc.
| [1{C:/ProgramData/MiKTeX/2.9/pdftex/config/pdftex.map}]
| (C:\Users\UD\Desktop\Renamed.aux) )<C: Program="" Files="" MiKTeX="" 2.9="" fonts="" type1="" publi="" |="" c="" amsfonts="" cm="" cmbx12.pfb=""><C: Program="" Files="" MiKTeX="" 2.9="" fonts="" type1="" public="" amsfon="" |="" ts="" cm="" cmr10.pfb="">
| Output written on Renamed.pdf (1 page, 20954 bytes).
| Transcript written on Renamed.log.
| texify: Windows API error 2: Das System kann die angegebene Datei nicht finden.
| texify: Data: Example.log

At the end you get a Windows-API-Error-Message.

I think the reason is that texify attempts to access a file with name "Example" while actually the name should be "Renamed".

( Another minor issue: Within the line
Running pdflatex -job-name=Renamed C:/Users/UD/Desktop\Example.tex...
two different characters (slash and backslash) are used for separating directories. )

The example above is very short. I stumbled over the problem of texify not taking into account a "-job-name-Option"-directive passed on by texify to the TeX-engine used for compiling via --tex-option="..." when I was attempting to automatize the process of creating circular letters by means of a TeX-input-file which within some sort of iterative loop performs a sequence of \write18-calls for executing the texify-program -- here is another example also delivering a bunch of Windows API-error-messages:

% File: ExampleB.tex
%
% texify --verbose --pdf ExampleB.tex
%
% LaTeX2e/texify
\csname @\ifx\receipID\UndefINed firstofone\else gobble\fi\endcsname{%
\newcommand*\HowManyReceipients{3}%
\newcount\receipID
\receipID=1
\loop
\immediate\write18{%
texify
--verbose
--pdf
--tex-option="-job-name=\jobname\number\receipID\space
\string\gdef\string\receipID{\number\receipID}%
\string\input\space\jobname.tex\%"
\jobname.tex%
}%
\ifnum\receipID<\HowManyReceipients\space
\advance\receipID 1 %
\repeat
\documentclass[a4paper]{article}%
\begin{document}%
Document not for recipients but with general remarks
about the form-letter.
\end{document}%
}%
\documentclass[a4paper]{article}%
\begin{document}%
Document for recipient \receipID.
\end{document}%

Typing at the command prompt:

texify --verbose --pdf ExampleB.tex

yields the following console/screen-output:

| C:\Users\UD\Desktop>texify --verbose --pdf ExampleB.tex
| Processing ExampleB.tex...
| Running pdflatex C:/Users/UD/Desktop\ExampleB.tex...
| This is pdfTeX, Version 3.1415926-2.4-1.40.13 (MiKTeX 2.9 64-bit)
| entering extended mode
| (C:/Users/UD/Desktop/ExampleB.tex
| LaTeX2e <2011/06/27>
| Babel <v3.8m> and hyphenation patterns for english, afrikaans, ancientgreek, ar
| abic, armenian, assamese, basque, bengali, bokmal, bulgarian, catalan, coptic,
| croatian, czech, danish, dutch, esperanto, estonian, farsi, finnish, french, ga
| lician, german, german-x-2012-05-30, greek, gujarati, hindi, hungarian, iceland
| ic, indonesian, interlingua, irish, italian, kannada, kurmanji, latin, latvian,
| lithuanian, malayalam, marathi, mongolian, mongolianlmc, monogreek, ngerman, n
| german-x-2012-05-30, nynorsk, oriya, panjabi, pinyin, polish, portuguese, roman
| ian, russian, sanskrit, serbian, slovak, slovenian, spanish, swedish, swissgerm
| an, tamil, telugu, turkish, turkmen, ukenglish, ukrainian, uppersorbian, usengl
| ishmax, welsh, loaded.
| Processing ExampleB.tex...
| Running pdflatex -job-name=ExampleB1 \gdef\receipID{1}\input ExampleB.tex\% C:/U
| sers/UD/Desktop\ExampleB.tex...
| This is pdfTeX, Version 3.1415926-2.4-1.40.13 (MiKTeX 2.9 64-bit)
| entering extended mode
| LaTeX2e <2011/06/27>
| Babel <v3.8m> and hyphenation patterns for english, afrikaans, ancientgreek, ar
| abic, armenian, assamese, basque, bengali, bokmal, bulgarian, catalan, coptic,
| croatian, czech, danish, dutch, esperanto, estonian, farsi, finnish, french, ga
| lician, german, german-x-2012-05-30, greek, gujarati, hindi, hungarian, iceland
| ic, indonesian, interlingua, irish, italian, kannada, kurmanji, latin, latvian,
| lithuanian, malayalam, marathi, mongolian, mongolianlmc, monogreek, ngerman, n
| german-x-2012-05-30, nynorsk, oriya, panjabi, pinyin, polish, portuguese, roman
| ian, russian, sanskrit, serbian, slovak, slovenian, spanish, swedish, swissgerm
| an, tamil, telugu, turkish, turkmen, ukenglish, ukrainian, uppersorbian, usengl
| ishmax, welsh, loaded.
| (C:\Users\UD\Desktop\ExampleB.tex
| ("C:\Program Files\MiKTeX 2.9\tex\latex\base\article.cls"
| Document Class: article 2007/10/19 v1.4h Standard LaTeX document class
| ("C:\Program Files\MiKTeX 2.9\tex\latex\base\size10.clo"))
| No file ExampleB1.aux.
| [1{C:/ProgramData/MiKTeX/2.9/pdftex/config/pdftex.map}]
| (C:\Users\UD\Desktop\ExampleB1.aux) )<C: Program="" Files="" MiKTeX="" 2.9="" fonts="" type1="" |="" public="" amsfonts="" cm="" cmr10.pfb="">
| Output written on ExampleB1.pdf (1 page, 13225 bytes).
| Transcript written on ExampleB1.log.
| texify: Windows API error 32: Der Prozess kann nicht auf die Datei zugreifen, da
| sie von einem anderen Prozess verwendet wird.
| texify: Data: ExampleB.log
| Processing ExampleB.tex...
| Running pdflatex -job-name=ExampleB2 \gdef\receipID{2}\input ExampleB.tex\% C:/U
| sers/UD/Desktop\ExampleB.tex...
| This is pdfTeX, Version 3.1415926-2.4-1.40.13 (MiKTeX 2.9 64-bit)
| entering extended mode
| LaTeX2e <2011/06/27>
| Babel <v3.8m> and hyphenation patterns for english, afrikaans, ancientgreek, ar
| abic, armenian, assamese, basque, bengali, bokmal, bulgarian, catalan, coptic,
| croatian, czech, danish, dutch, esperanto, estonian, farsi, finnish, french, ga
| lician, german, german-x-2012-05-30, greek, gujarati, hindi, hungarian, iceland
| ic, indonesian, interlingua, irish, italian, kannada, kurmanji, latin, latvian,
| lithuanian, malayalam, marathi, mongolian, mongolianlmc, monogreek, ngerman, n
| german-x-2012-05-30, nynorsk, oriya, panjabi, pinyin, polish, portuguese, roman
| ian, russian, sanskrit, serbian, slovak, slovenian, spanish, swedish, swissgerm
| an, tamil, telugu, turkish, turkmen, ukenglish, ukrainian, uppersorbian, usengl
| ishmax, welsh, loaded.
| (C:\Users\UD\Desktop\ExampleB.tex
| ("C:\Program Files\MiKTeX 2.9\tex\latex\base\article.cls"
| Document Class: article 2007/10/19 v1.4h Standard LaTeX document class
| ("C:\Program Files\MiKTeX 2.9\tex\latex\base\size10.clo"))
| No file ExampleB2.aux.
| [1{C:/ProgramData/MiKTeX/2.9/pdftex/config/pdftex.map}]
| (C:\Users\UD\Desktop\ExampleB2.aux) )<C: Program="" Files="" MiKTeX="" 2.9="" fonts="" type1="" |="" public="" amsfonts="" cm="" cmr10.pfb="">
| Output written on ExampleB2.pdf (1 page, 13415 bytes).
| Transcript written on ExampleB2.log.
| texify: Windows API error 32: Der Prozess kann nicht auf die Datei zugreifen, da
| sie von einem anderen Prozess verwendet wird.
| texify: Data: ExampleB.log
| Processing ExampleB.tex...
| Running pdflatex -job-name=ExampleB3 \gdef\receipID{3}\input ExampleB.tex\% C:/U
| sers/UD/Desktop\ExampleB.tex...
| This is pdfTeX, Version 3.1415926-2.4-1.40.13 (MiKTeX 2.9 64-bit)
| entering extended mode
| LaTeX2e <2011/06/27>
| Babel <v3.8m> and hyphenation patterns for english, afrikaans, ancientgreek, ar
| abic, armenian, assamese, basque, bengali, bokmal, bulgarian, catalan, coptic,
| croatian, czech, danish, dutch, esperanto, estonian, farsi, finnish, french, ga
| lician, german, german-x-2012-05-30, greek, gujarati, hindi, hungarian, iceland
| ic, indonesian, interlingua, irish, italian, kannada, kurmanji, latin, latvian,
| lithuanian, malayalam, marathi, mongolian, mongolianlmc, monogreek, ngerman, n
| german-x-2012-05-30, nynorsk, oriya, panjabi, pinyin, polish, portuguese, roman
| ian, russian, sanskrit, serbian, slovak, slovenian, spanish, swedish, swissgerm
| an, tamil, telugu, turkish, turkmen, ukenglish, ukrainian, uppersorbian, usengl
| ishmax, welsh, loaded.
| (C:\Users\UD\Desktop\ExampleB.tex
| ("C:\Program Files\MiKTeX 2.9\tex\latex\base\article.cls"
| Document Class: article 2007/10/19 v1.4h Standard LaTeX document class
| ("C:\Program Files\MiKTeX 2.9\tex\latex\base\size10.clo"))
| No file ExampleB3.aux.
| [1{C:/ProgramData/MiKTeX/2.9/pdftex/config/pdftex.map}]
| (C:\Users\UD\Desktop\ExampleB3.aux) )<C: Program="" Files="" MiKTeX="" 2.9="" fonts="" type1="" |="" public="" amsfonts="" cm="" cmr10.pfb="">
| Output written on ExampleB3.pdf (1 page, 13477 bytes).
| Transcript written on ExampleB3.log.
| texify: Windows API error 32: Der Prozess kann nicht auf die Datei zugreifen, da
| sie von einem anderen Prozess verwendet wird.
| texify: Data: ExampleB.log
| ("C:\Program Files\MiKTeX 2.9\tex\latex\base\article.cls"
| Document Class: article 2007/10/19 v1.4h Standard LaTeX document class
| ("C:\Program Files\MiKTeX 2.9\tex\latex\base\size10.clo"))
| No file ExampleB.aux.
| [1{C:/ProgramData/MiKTeX/2.9/pdftex/config/pdftex.map}]
| (C:\Users\UD\Desktop\ExampleB.aux) )<C: Program="" Files="" MiKTeX="" 2.9="" fonts="" type1="" p="" |="" ublic="" amsfonts="" cm="" cmr10.pfb="">
| Output written on ExampleB.pdf (1 page, 15290 bytes).
| Transcript written on ExampleB.log.
| Backing up xref files: ExampleB.aux
| Running pdflatex C:/Users/UD/Desktop\ExampleB.tex...
| This is pdfTeX, Version 3.1415926-2.4-1.40.13 (MiKTeX 2.9 64-bit)
| entering extended mode
| (C:/Users/UD/Desktop/ExampleB.tex
| LaTeX2e <2011/06/27>
| Babel <v3.8m> and hyphenation patterns for english, afrikaans, ancientgreek, ar
| abic, armenian, assamese, basque, bengali, bokmal, bulgarian, catalan, coptic,
| croatian, czech, danish, dutch, esperanto, estonian, farsi, finnish, french, ga
| lician, german, german-x-2012-05-30, greek, gujarati, hindi, hungarian, iceland
| ic, indonesian, interlingua, irish, italian, kannada, kurmanji, latin, latvian,
| lithuanian, malayalam, marathi, mongolian, mongolianlmc, monogreek, ngerman, n
| german-x-2012-05-30, nynorsk, oriya, panjabi, pinyin, polish, portuguese, roman
| ian, russian, sanskrit, serbian, slovak, slovenian, spanish, swedish, swissgerm
| an, tamil, telugu, turkish, turkmen, ukenglish, ukrainian, uppersorbian, usengl
| ishmax, welsh, loaded.
| Processing ExampleB.tex...
| Backing up xref files: ExampleB.aux
| texify: Windows API error 32: Der Prozess kann nicht auf die Datei zugreifen, da
| sie von einem anderen Prozess verwendet wird.
| texify: Data: ExampleB.log
| Processing ExampleB.tex...
| Backing up xref files: ExampleB.aux
| texify: Windows API error 32: Der Prozess kann nicht auf die Datei zugreifen, da
| sie von einem anderen Prozess verwendet wird.
| texify: Data: ExampleB.log
| Processing ExampleB.tex...
| Backing up xref files: ExampleB.aux
| texify: Windows API error 32: Der Prozess kann nicht auf die Datei zugreifen, da
| sie von einem anderen Prozess verwendet wird.
| texify: Data: ExampleB.log
| ("C:\Program Files\MiKTeX 2.9\tex\latex\base\article.cls"
| Document Class: article 2007/10/19 v1.4h Standard LaTeX document class
| ("C:\Program Files\MiKTeX 2.9\tex\latex\base\size10.clo"))
| (C:\Users\UD\Desktop\ExampleB.aux) [1{C:/ProgramData/MiKTeX/2.9/pdftex/config/
| pdftex.map}]
(C:\Users\UD\Desktop\ExampleB.aux) )<C: Program="" Files="" MiKTeX="" 2.9="" |="" fonts="" type1="" public="" amsfonts="" cm="" cmr10.pfb="">
| Output written on ExampleB.pdf (1 page, 15290 bytes).
| Transcript written on ExampleB.log.
| Comparing xref file ExampleB.aux...
|
| C:\Users\UD\Desktop>

Probably the issue could be resolved by implementing the possibility of passing on some sort of -job-name-option to the texify-program itself. This way texify would "know" about the names of the files that actually were created by the TeX-engine used for compiling...

The question is whether such a texify-jobname-option should be passed on as -job-name-option to the TeX-compiler automatically or whether this should not happen automatically but instead an additional note within the manual of the texify-program would point out that when providing the texify-jobname-option you most likely also have to provide a --tex-option of the pattern --tex-option="-job-name=<altered jobname="">"...

By the way: Both examples from above deliver Windows-API-error-messages when being compiled using texify as of MiKTeX 2.9.

But there are no error-messages when compiling them via old MiKTeX 2.4' texify (both under Win'95 and under Win7 in compatibility-mode).

I don't know whether no error-messages occurring under MiKTeX 2.4 is due to corresponding error-messages being suppressed/being redirected from the std-console-output to somewhere else or whether this is due to texify of MiKTeX 2.4 working in a way where such errors do not come into being at all.

Sincerely

Ulrich Diez

Discussion