Joe English | 3 Jul 19:12

Re: Future [exec] overhaul


Lars.Hellstrom wrote:
>
> As I understand it, there is a problem (orthogonal to the actual [exec]
>   syntax) in Windows in that the programs don't get a list of
> arguments, but only a "command-line" string which they have to parse
> themselves (and therefore they do so inconsistently). On that platform
> Tcl consequently needs to quote the arguments (and because of the
> inconsistencies doesn't always succeed). Do you plan to address that
> issue as well?

One approach is to just do things differently on Windows
and on Unix:

    <pipeline> ::= <process> ( "|" <process> )*
    <process> ::= <os-command> ( <redirection> | <option> <value> )*

where <os-command> is interpreted as a list on Unix
and used to build the argv array passed to exec*();
and as a string on Windows, used as the lpCommandLine
argument to CreateProcess().

On Unix, the first element of the list would also be used as the 
"file" argument to exec*p(); on Windows we could parse out
the lpApplicationName argument using the same algorithm
that CMD.EXE does.

--JE

-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08

Gmane