whitespace - Lua and the white spaces in an OS -


after reading post, used [[ ]] put commands system. problem following: same structure:

local program = [["c:\archivos de programa\automated qa\testcomplete 8\bin\testcomplete.exe" ]]; local testcase = [["c:\svn_test\trunk\automation\xmm\xmm.pjs" ]]; local options = [[/r /exit /p:xmmgeneraltest /t:"script|main|main" ]];  local cmd = program..testcase..options; print(cmd); os.execute(cmd);  local tclog = [[ c:\svn_test\trunk\automation\xtyle\xtylegeneraltest\log\11_04_2011_12_40_06_264\*]]; local zippedfile = "11_04_2011_12_40_06_264.7z "; local sevenzip = [["c:\archivos de programa\7-zip\7z.exe" -t7z ]];  local cmd = sevenzip..zippedfile..tclog; print(cmd); os.execute(cmd); 

the same code produce different results. first 1 doesn't run:

"c:\archivos" not recognized internal command or external, program... 

the second 1 runs perfectly.

how can resolve this?

i don't have windows system test with, guess:

try replacing this:

local program = [["c:\archivos de programa\automated qa\testcomplete 8\bin\testcomplete.exe" ]]; 

with this:

local program = [[c:\\archivos\ de\ programa\\automated\ qa\\testcomplete\ 8\\bin\\testcomplete.exe ]]; 

i fear won't work since [[ , ]] block interpretation of escapes, may change goes 1 variable , os.execute. other option use windows version of these files without spaces, e.g.:

local program = [[c:\archiv~1\automa~1\testco~1\bin\testcomplete.exe ]]; 

Comments

Popular posts from this blog

php - What is the difference between $_SERVER['PATH_INFO'] and $_SERVER['ORIG_PATH_INFO']? -

fortran - Function return type mismatch -

queue - mq_receive: message too long -