From: Keith on
[list exec "explorer.exe /root,$qpl(data)"]

couldn't execute "explorer.exe \root,L:\bc246t\data": no such file or
directory
"exec {explorer.exe /root,L:/bc246t/data} &"

I have tried to use \/root with the same problems.

What is the easiest way to avoid this error in tcl/tk 8.4 in windows 98
and above.

TIA.


--
Best Regards, Keith
http://home.comcast.net/~kilowattradio/
America's Debt. The greatest Ponzi scheme ever Devised.
http://www.usdebtclock.org/
wir sind wahr
From: Robert Heller on
At Sat, 31 Jul 2010 13:31:59 -0700 Keith <kilowattradio(a)use-reply-to.invalid> wrote:

>
> [list exec "explorer.exe /root,$qpl(data)"]

[list exec "explorer.exe" "/root,$qpl(data)"]

>
> couldn't execute "explorer.exe \root,L:\bc246t\data": no such file or
> directory
> "exec {explorer.exe /root,L:/bc246t/data} &"
>
> I have tried to use \/root with the same problems.
>
> What is the easiest way to avoid this error in tcl/tk 8.4 in windows 98
> and above.

THE EXEC COMMAND TAKES A BUNCH OF ARGS, NOT A SINGLE STRING!

This seems to be a *frequent* newbie error.

If necessary, eval (8.4) or the '*' notation (8.5+) is your friend:

eval [list exec "explorer.exe" "/root,$qpl(data)"] &

>
> TIA.
>
>

--
Robert Heller -- Get the Deepwoods Software FireFox Toolbar!
Deepwoods Software -- Linux Installation and Administration
http://www.deepsoft.com/ -- Web Hosting, with CGI and Database
heller(a)deepsoft.com -- Contract Programming: C/C++, Tcl/Tk


From: Keith on
On Sat, 31 Jul 2010 16:55:07 -0500, Robert Heller <heller(a)deepsoft.com>
wrote in
[ comp.lang.tcl ]:

> At Sat, 31 Jul 2010 13:31:59 -0700 Keith <kilowattradio(a)use-reply-to.invalid> wrote:
>
> >
> > [list exec "explorer.exe /root,$qpl(data)"]
>
> [list exec "explorer.exe" "/root,$qpl(data)"]
>
> >
> > couldn't execute "explorer.exe \root,L:\bc246t\data": no such file or
> > directory
> > "exec {explorer.exe /root,L:/bc246t/data} &"
> >
> > I have tried to use \/root with the same problems.
> >
> > What is the easiest way to avoid this error in tcl/tk 8.4 in windows 98
> > and above.
>
> THE EXEC COMMAND TAKES A BUNCH OF ARGS, NOT A SINGLE STRING!
>
> This seems to be a *frequent* newbie error.
>
> If necessary, eval (8.4) or the '*' notation (8.5+) is your friend:
>
> eval [list exec "explorer.exe" "/root,$qpl(data)"] &
>
> >
> > TIA.
> >
> >

Well here is what I had to do in tcl 8.4 to get it to work. I had tried
the eval earlier but left out curly brackets:

regsub -all {/} $qpl(data) {\\} qpl(rf)
pack [button $gx.a.2 -text "View in Explorer" -command {eval [list exec
"explorer.exe" "/e,/root,$qpl(rf)" &]}] -side top -anchor n} \

--
Best Regards, Keith
http://home.comcast.net/~kilowattradio/
America's Debt. The greatest Ponzi scheme ever Devised.
http://www.usdebtclock.org/
wir sind wahr
From: Ralf Fassel on
* Keith <kilowattradio(a)use-reply-to.invalid>
| ... -command {eval [list exec "explorer.exe" "/e,/root,$qpl(rf)" &]} ...

Why use 'eval' here?
Why does
... -command [list exec "explorer.exe" "/e,/root,$qpl(rf)" &] ...
not work?

R'
From: Robert Heller on
At Sun, 01 Aug 2010 18:13:54 +0200 Ralf Fassel <ralfixx(a)gmx.de> wrote:

>
> * Keith <kilowattradio(a)use-reply-to.invalid>
> | ... -command {eval [list exec "explorer.exe" "/e,/root,$qpl(rf)" &]} ...
>
> Why use 'eval' here?

I don't know what Keith originally wanted to do. Most of the time
people do things like create command strings (instead of just calling
exec with the bunch of arguments), they are building up the command line
some how. Building it up with append (or inlined string building) does
not work, one needs to use lappend or list. The result needs to be
'flattened' as an argument *list* to exec and the easiest was to do that
is with eval. I was just giving the typical tcl idiom for doing this.

> Why does
> ... -command [list exec "explorer.exe" "/e,/root,$qpl(rf)" &] ...
> not work?

It would work just fine, if that was what Keith was doing.

... -command [list exec "explorer.exe /e,/root,$qpl(rf)" &] ...

does NOT work...

>
> R'
>

--
Robert Heller -- 978-544-6933
Deepwoods Software -- Download the Model Railroad System
http://www.deepsoft.com/ -- Binaries for Linux and MS-Windows
heller(a)deepsoft.com -- http://www.deepsoft.com/ModelRailroadSystem/