Tcl Source Code

View Ticket
Login
Ticket UUID: 1106853
Title: On Linux, exec >@channel may give incorrect error
Type: Bug Created on: 2005-01-21 17:33:34
Submitter: nobody Assigned to: andreas_kupries
Subsystem: 25. Channel System Severity:
Priority: 5 Medium Last modified: 2026-10-22 17:19:30
Status: Closed Closed by: serhiy.storchaka
Resolution: Fixed Closed on: 2026-10-21 10:03:37
Version: None
Description:
If I create a channel in C code with Tcl_CreateChannel
(passing in TCL_WRITABLE) then try to output to it
using exec, like so:

% exec ls >@channel

I get the error message (under Linux):

channel "foo" wasn't opened for writing

The actual cause of the error is that there's no file
handle associated with my channel. I don't mind that
this doesn't work, but the error message is confusing,
especially since the channel patently is open for
writing, since:

% puts channel "some string"

works fine.

This is with Tcl 8.4.7.
User Comments:
serhiy.storchaka added on 2026-10-21 10:03:37:

Fixed in 8.5.8 and 8.6.0 by [9039eeb584] (8.5: [62c8e5320a]): for a channel without OS handles, exec redirection now reports channel "x" does not support OS handles instead of "wasn't opened for writing".