[Dev-luatex] os.spawn and argv[1] with sapces

T T t34www at googlemail.com
Mon Nov 23 18:41:37 CET 2009


Hi,

I have encountered a problem with os.spawn(arg) on Windows. If
arg[1]='foo bar' and arg[0]=nil, then the spawned process gets 'foo'
as argv[0] and 'bar' as argv[1]. This might be expected, since
according to docs, os.spawn doesn't do any argument processing.

So I tried double quoting arg[1]='"foo bar"' (i.e. double quotes are
part of arg[1]) but then os.spawn fails with invalid argument error.
Is this expected?

Furthermore, passing a string '"foo bar"' to os.spawn (including the
double quotes) instead of a table, results in spawning 'foo bar' but
again with 'foo' as argv[0] and 'bar' as argv[1]. The only way I found
to properly spawn a command with spaces is by giving arg[0]
explicitly:

 arg={[0]='foo bar', '"foo bar"', ...}

Cheers,

Tomek


More information about the dev-luatex mailing list