[tex-live] [luatex] [lltx] Location of recorder file

Reinhard Kotucha reinhard.kotucha at web.de
Tue May 17 22:23:39 CEST 2011


On 2011-05-17 at 10:43:54 +0200, Philipp Stephani wrote:

 > Am 17.05.2011 um 01:27 schrieb Reinhard Kotucha:

 > > There were differences regarding file permissions.  In cmd.exe I
 > > was sometimes unable to [re]move files.  I got a "permission
 > > denied" error though I could [re]move the files in the Exploder.
 > > I don't know what caused the file permission problem, but I
 > > vaguely remember that it sometimes could be solved by setting the
 > > executable flag under Cygwin, though I don't understand why.
 > 
 > AFAIK there can't be any such differences since both the console
 > and the Explorer only report back the errors reported by the
 > kernel. Maybe you ran the Explorer with elevated privileges in that
 > case?

I always had admin rights.

 > > Well, since we painfully had to learn that even if you pass
 > > arguments as a list to execve(), you still have to quote
 > > arguments because Windows converts the argument list to a string
 > > and then back to a list internally, before passing the arguments
 > > to its child process, I doubt that even low-level functions avoid
 > > the shell.
 > 
 > No, you shouldn't have to quote anything, that's what the
 > language's standard library is for. For example, Python converts an
 > argument list to a command-line string using the list2cmdline
 > functions: 
 >>> print subprocess.list2cmdline(["a b", r'c" d\""ef g']) "a b" "c\"
 > d\\\"\"ef g"
 > Indeed this is something that only the
 > language runtime can do: the spawn* functions indeed don't quote
 > their arguments properly, as discussed in
 > http://msdn.microsoft.com/en-us/library/20y988d2.aspx. As usual,
 > that behavior can't be changed because it could break
 > anything. Therefore I think the spawn* and exec* functions should
 > be avoided altogether: if you have to preprocess the argument
 > vector in any case, directly calling CreateProcessW isn't such a
 > big deal either.
 > 
 > > 
 > > Look at
 > > 
 > >  texmf/scripts/texlive/rungs.tlu 
 > > 
 > > in order to see how we solve the problem ATM.  It would be nice
 > > to have the annoying function fixwin() integrated in texlua,
 > > similarly as it's integrated in Perl.  However, Taco won't do
 > > that without a clear specification from Microsoft.
 > > Understandably.  But we didn't find any specifications so far.
 > 
 > The rules are described here:
 > http://msdn.microsoft.com/en-us/library/17w5ykft(v=VS.100).aspx

Thanks for this link.  I think it's quite helpful.

 > However, I think adding them to luatex isn't such a good idea since
 > it would widen the gap between stock Lua and LuaTeX even more. 

The gap between stock Lua and LuaTeX is already quite large.  What I
miss in stock Lua is TeX, for example. :)

Well, I don't think that the gap has to be kept small in the first
place.  Lua is designed to be embedded in programs on a particular
platform and is not aware of the operating system at all.  It just
inherits behavior from the operating system it runs on, for instance
line endings.  I'd like to use texlua as a general, platform
independent scripting language without the need of conditional code
for different platforms in the scripts.  As a first step into this
direction, Taco made io.read('*lines') line ending neutral.  There are
not many differences between Lua and LuaTeX, mostly extensions, which
are described in the manual.

Lua provides os.execute() as the only function for calling external
programs.  Taco added os.exec(), which was supposed to replace the
current process image by another one.  Since this doesn't work as
expected on Windows, he added os.spawn().  All these functions
expected a string as an argument, which means that file names with
spaces have to be quoted in each script, which is quite annoying.
Also, string concatenation is quite ugly.  With table support we can
simply pass arg{} to the new process.

Therefore I asked Taco to add support for Lua tables to
the new functions.  They now accept either a string or a table.

If you pass arguments as a table, you don't have to quote, except on
Windows.  I looked at the description of CreateProcess() and it seems
that it accepts a string only.  However, I suppose that

  http://msdn.microsoft.com/en-us/library/20y988d2.aspx

is the specification Taco was missing.

 > The best thing would be to write an extension module that wraps
 > CreateProcessW directly.  If it's only about calculating the
 > command line from an argument vector (i.e. the list2cmdline)
 > function, then that can be done in pure Lua.

Sure, this is quite similar to what the fixwin() function does, though
the latter doesn't create a string, but it would be much nicer if we
can avoid it completely.

Regards,
  Reinhard

-- 
----------------------------------------------------------------------------
Reinhard Kotucha                                      Phone: +49-511-3373112
Marschnerstr. 25
D-30167 Hannover                              mailto:reinhard.kotucha at web.de
----------------------------------------------------------------------------
Microsoft isn't the answer. Microsoft is the question, and the answer is NO.
----------------------------------------------------------------------------


More information about the tex-live mailing list