Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

TC 18.00 x64 issue with lua io.popen()

Feb
7
0
We just upgraded from TC 15.00 x64 to TC 18.00.18 x64. We have some lua scripts that execute .bat files via io.popen(). The argument to popen() is a table, with the first entry being a quoted string of the full path to the .bat file with Unix style slashes. Subsequent arguments are parameters to the batch file. Something like this:

args[0] = '"D:/dev/bin/SyncP4Changelist.bat"'
args[1] = 'option1'

They worked fine under TC 15.00 but don't from a 18.00 TC Prompt.

We see this error message when the popen() call is made:

TCC: Unknown command "D:"

If I enable UNIX/Linux-style paths I get this error:

TCC: Unknown command "D:/dev/bin/SyncP4Changelist.bat option1"

If I remove the double quotes from args[0] it works. I'd prefer not to have to do that as it may break compatibility with other shells and there are a lot of lua scripts I'd have to change.

Thanks.
 
We just upgraded from TC 15.00 x64 to TC 18.00.18 x64. We have some lua scripts that execute .bat files via io.popen(). The argument to popen() is a table, with the first entry being a quoted string of the full path to the .bat file with Unix style slashes. Subsequent arguments are parameters to the batch file. Something like this:

args[0] = '"D:/dev/bin/SyncP4Changelist.bat"'
args[1] = 'option1'

Not sure exactly what you're doing here -- are you quoting the arguments with both outer single quotes and inner double quotes?

Are you using the TCC internal Lua support or an external Lua interpreter?
 
Sorry, should have been clearer. Those lines are cut from the Lua script, so the outer singe quotes are part of the Lua script and consumed by the Lua interpreter. The inner double quotes are part of the string itself. The string in memory ends up as exactly "D:/dev/bin/SyncP4Changelist.bat".

We're using an external Lua interpreter. Although I better check that to be 100% sure.

Thanks.
 
Back
Top
[FOX] Ultimate Translator
Translate