1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

TC 18.00 x64 issue with lua io.popen()

Discussion in 'Support' started by jbarnes1967, Jun 19, 2015.

  1. jbarnes1967

    Joined:
    Feb 17, 2013
    Messages:
    7
    Likes Received:
    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.
     
  2. rconn

    rconn Administrator
    Staff Member

    Joined:
    May 14, 2008
    Messages:
    9,854
    Likes Received:
    83
    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?
     
  3. jbarnes1967

    Joined:
    Feb 17, 2013
    Messages:
    7
    Likes Received:
    0
    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.
     

Share This Page