Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[Bug Tcl 8.1b1] console1 wasn't opened for writing under win32

96 views
Skip to first unread message

aldo.m...@inrialpes.fr

unread,
Feb 3, 1999, 3:00:00 AM2/3/99
to
Tcl 8.1b1 Bug: Generated by Scriptics' bug entry form at

http://www.scriptics.com/support/bugForm.html

Responses to this post are encouraged.

------

Submitted by: Aldo MAZZILLI
OperatingSystem: Windows NT
OperatingSystemVersion: Workstation NT4.0
Synopsis: console1 wasn't opened for writing under win32

ReproducibleScript:
if [catch {open "|sh 2>@ stdout" r+} input] {
Error
} else {
fconfigure $input -buffering none
fileevent $input readable Log
}
..

proc Log {} {
global input
if {[gets $input line]<0} {
close $input
} else {
.f.text insert end $line\n
.f.text see end
}
}


PutCmd {} {
puts $input "$cmd \n"
}


ObservedBehavior:
I'm trying to port a TCL script from SUN-OS to Win32 and I have the
following message "console1 wasn't opened for writing" when I 'puts' a
command in a pipeline.


DesiredBehavior:
The pipelined Shell must run the command that the user 'puts' on it and must get everything on stdout and stderr in order to display the both results in a text widget.
Everything works correctly under Sun-OS but fails under win32.

Dave LeBlanc

unread,
Feb 3, 1999, 3:00:00 AM2/3/99
to
That message shows up when you're using Wish81.exe on Windows. Windows
does not support stdio for GUI apps.

The open "sh 2> ..... " looks suspicious too unless you have a shell
program on Windows - the "shell" (poor though it is) is called cmd.exe
on Windows. It also does not support most unix shell commands and not
even some forms of redirection.

Dave LeBlanc

Xiaoyong Wu

unread,
Feb 3, 1999, 3:00:00 AM2/3/99
to
hi,
Actually, when you use Tcl plugin for netscape, you also meet this problem.
One simple way to solve that:
use an output label, and put everything goes to stdout to that.
-Xiaoyong

Aldo Mazzilli

unread,
Feb 4, 1999, 3:00:00 AM2/4/99
to
Dave LeBlanc wrote:
>
> That message shows up when you're using Wish81.exe on Windows. Windows
> does not support stdio for GUI apps.
>
> The open "sh 2>@ stdout" looks suspicious too unless you have a shell

> program on Windows - the "shell" (poor though it is) is called cmd.exe
> on Windows. It also does not support most unix shell commands and not
> even some forms of redirection.
>

Thanks a lot for your so quick response but I have to tell you another
thing :
you were right when you say that I may have a shell on Windows.

I forget to tell you that I invoke my TCL script using (for testing)
2 kinds of shell :
- ksh from the MKS Toolkit
- bash from Cygwin32

And none of them give me a right result for "stderr" ("|sh 2>@ stdout").
However, these both two solutions works very well when just reading
stdout ("|sh").

Any other ideas ??
Thanks
--
=======================================================================
,',',',',',',' Aldo MAZZILLI | INRIA Rhone-Alpes |
,',',',',',',' aldo.m...@inrialpes.fr| 655, avenue de l'Europe |
,',',',',',',' Tel : 04 76 61 53 91 | 38330 Montbonnot St Martin |
,',',',',',',' Fax : 04 76 61 52 52 | FRANCE |
,',' *** Site WEB : http://www.inrialpes.fr/vasy/people/Aldo.Mazzilli |
=======================================================================

Mumit Khan

unread,
Feb 4, 1999, 3:00:00 AM2/4/99
to
In article <36B954...@inria.fr>,

Aldo Mazzilli <aldo.m...@inria.fr> wrote:
> you were right when you say that I may have a shell on Windows.
>
>I forget to tell you that I invoke my TCL script using (for testing)
>2 kinds of shell :
>- ksh from the MKS Toolkit
>- bash from Cygwin32
>
>And none of them give me a right result for "stderr" ("|sh 2>@ stdout").
>However, these both two solutions works very well when just reading
>stdout ("|sh").
>
>Any other ideas ??

I use the following on Unix and win32:

set fd [open "|sh -c \"program_name program_args 2>&1\"" r]

and then read away. I use Cygwin on win32, but should work with MKS just
as well.

Regards,
Mumit

Dave LeBlanc

unread,
Feb 5, 1999, 3:00:00 AM2/5/99
to
Well, my memory is rusty, but isn't "2" stderr? If so, dear old
@#$%@!!! Windows doesn't natively support redirection of stderr - nor
did dos #@$%@!!!

There is a program floating around (sorry, don't know where) called
Tee that enables you to capture/redirect stderr on dos or console
apps.

Dave LeBlanc

On Thu, 04 Feb 1999 09:04:45 +0100, Aldo Mazzilli
<aldo.m...@inria.fr> wrote:

>Dave LeBlanc wrote:
>>
>> That message shows up when you're using Wish81.exe on Windows. Windows
>> does not support stdio for GUI apps.
>>
>> The open "sh 2>@ stdout" looks suspicious too unless you have a shell
>> program on Windows - the "shell" (poor though it is) is called cmd.exe
>> on Windows. It also does not support most unix shell commands and not
>> even some forms of redirection.
>>
>
>Thanks a lot for your so quick response but I have to tell you another
>thing :

> you were right when you say that I may have a shell on Windows.
>
>I forget to tell you that I invoke my TCL script using (for testing)
>2 kinds of shell :
>- ksh from the MKS Toolkit
>- bash from Cygwin32
>
>And none of them give me a right result for "stderr" ("|sh 2>@ stdout").
>However, these both two solutions works very well when just reading
>stdout ("|sh").
>
>Any other ideas ??

0 new messages