This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [BUG?] run.exe and pdflatex


>> so i have a latex file here. "pdflatex document.tex" works. But "run
>> pdflatex document.tex" does not.
>>
>> "run.exe" seems to be the best way to call cygwin application from
>> external windows apps. But the seems to be some difference from invoking
>> by a shell.
>>
>> pdfetex seems to check the name by it has been invoked. When invoking
>> from the shell, it correctly finds out, that it has been invoked as
>> "pdflatex" but when invoked via run.exe, this check seems to lead to the
>> wrong result.
>>
>> I guess, it's a bug of run.exe which might do more work, than it should
>> (like following symbolic links, or such stuff).
> 
> This is not really a bug in run.exe, because it was never documented to
> work correctly with symlinks, and you'd get the same problem with any pure
> Windows way of invoking pdflatex anyway.  But it is, arguably, a
> deficiency in run.exe.

Hmm. I looked at the man pages, which says, that run's purpose is to
hide the console windows. Hmm. Maybe i'm kind of "misusing" the problem
right now.

But is there another easy way to execute cygwin programs from outside
cygwin? I think of symlinks, shell-scripts, perl-scripts, etc...
Using run.exe is quite handy for these cases.

> You can do a few things.  One is to pass an explicit parameter that tells
> pdfetex to use pdflatex mode (i.e., "-fmt pdflatex").

That's maybe a good idea - but won't work for pslatex, since pslatex is
a shell script.

>  Another is to
> invoke pdflatex via bash (i.e., "run bash -c 'pdflatex ...'").

Actually i HATE the bash -c "command param1 param2 ..." way of invoking
commands. It needs special escaping of white spaces and other special
characters, which usually nobody takes cares about causing unexpected
behaviour.
The way run.exe or sudo do it is much more elegant and transparent.

> Finally,
> you can look at the sources for run.exe (available via Cygwin setup) and
> submit a patch (look at the first argument to CreateProcess).

I'm not a unix-programmer unfortunatly. I'm not very familiar with the APIs.

Well, i will look into the source and try to find out, what run.exe is
actually doing. But CreateProcess sounds like a windows API call.
Wouldn't it be more elegant to use a cygwin-call similar to the one bash
uses?

But is run.exe linked against cygwin.dll?

Attachment: signature.asc
Description: OpenPGP digital signature


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]