Rocksolid Light

News from da outaworlds

mail  files  register  groups  login

Message-ID:  

Your life would be very empty if you had nothing to regret.


comp / comp.lang.tcl / Re: Bidirectional open?

SubjectAuthor
* Bidirectional open?saito
`* Re: Bidirectional open?Rich
 `* Re: Bidirectional open?saito
  `- Re: Bidirectional open?et99

1
Subject: Bidirectional open?
From: saito
Newsgroups: comp.lang.tcl
Organization: A noiseless patient Spider
Date: Wed, 22 May 2024 18:59 UTC
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: saitology9@gmail.com (saito)
Newsgroups: comp.lang.tcl
Subject: Bidirectional open?
Date: Wed, 22 May 2024 14:59:38 -0400
Organization: A noiseless patient Spider
Lines: 3
Message-ID: <v2lfar$1afln$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Wed, 22 May 2024 20:59:40 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="0db6a51a0b8778de685a286c2d711c4e";
logging-data="1392311"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX181RBErwQ0ljXgB30h5I6hf"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:TXk4YXkBlvgnP1XAMJCdhU9iTbM=
Content-Language: en-US
View all headers

When you use a open/pipe command like [open "| xyz ...]", is it possible
to configure it in both read and write modes? So I can write to it to
send info to xyz and read its output?

Subject: Re: Bidirectional open?
From: Rich
Newsgroups: comp.lang.tcl
Organization: A noiseless patient Spider
Date: Wed, 22 May 2024 19:32 UTC
References: 1
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: rich@example.invalid (Rich)
Newsgroups: comp.lang.tcl
Subject: Re: Bidirectional open?
Date: Wed, 22 May 2024 19:32:17 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 19
Message-ID: <v2lh81$1ardp$1@dont-email.me>
References: <v2lfar$1afln$1@dont-email.me>
Injection-Date: Wed, 22 May 2024 21:32:17 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="0ccccab43c229a5d24cbd1799fc4d570";
logging-data="1404345"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+DiIB+nC+YQeiHn7+g1lmy"
User-Agent: tin/2.6.1-20211226 ("Convalmore") (Linux/5.15.139 (x86_64))
Cancel-Lock: sha1:fPwka7V6cztQPk3GVXZoNu0hE8w=
View all headers

saito <saitology9@gmail.com> wrote:
> When you use a open/pipe command like [open "| xyz ...]", is it possible
> to configure it in both read and write modes? So I can write to it to
> send info to xyz and read its output?

This is trivial for you to discover on your own:

$ rlwrap tclsh
% set fd [open "|cat -" {RDWR}]
file5
% fconfigure $fd -buffering none
% puts $fd hello
% gets $fd
hello
% exit

Note that the '-buffering none' is to be sure that the first puts of
'hello' got flushed to cat to be returned.

Subject: Re: Bidirectional open?
From: saito
Newsgroups: comp.lang.tcl
Organization: A noiseless patient Spider
Date: Wed, 22 May 2024 19:38 UTC
References: 1 2
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: saitology9@gmail.com (saito)
Newsgroups: comp.lang.tcl
Subject: Re: Bidirectional open?
Date: Wed, 22 May 2024 15:38:14 -0400
Organization: A noiseless patient Spider
Lines: 15
Message-ID: <v2lhj7$1augh$1@dont-email.me>
References: <v2lfar$1afln$1@dont-email.me> <v2lh81$1ardp$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Wed, 22 May 2024 21:38:16 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="0db6a51a0b8778de685a286c2d711c4e";
logging-data="1407505"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX182u0ZxbbBd6qkU33iXZrHh"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:1epqdQfPUbW/dEMo7yNI46XkBVE=
In-Reply-To: <v2lh81$1ardp$1@dont-email.me>
Content-Language: en-US
View all headers

On 5/22/2024 3:32 PM, Rich wrote:
> saito <saitology9@gmail.com> wrote:
>> When you use a open/pipe command like [open "| xyz ...]", is it possible
>> to configure it in both read and write modes? So I can write to it to
>> send info to xyz and read its output?
>
> This is trivial for you to discover on your own:
>

You are right; give it to mental fog.

Thank you.

Subject: Re: Bidirectional open?
From: et99
Newsgroups: comp.lang.tcl
Organization: A noiseless patient Spider
Date: Thu, 23 May 2024 19:05 UTC
References: 1 2 3
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: et99@rocketship1.me (et99)
Newsgroups: comp.lang.tcl
Subject: Re: Bidirectional open?
Date: Thu, 23 May 2024 12:05:42 -0700
Organization: A noiseless patient Spider
Lines: 31
Message-ID: <v2o426$1ss0f$1@dont-email.me>
References: <v2lfar$1afln$1@dont-email.me> <v2lh81$1ardp$1@dont-email.me>
<v2lhj7$1augh$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Thu, 23 May 2024 21:05:43 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="5d721af09e7309c2eb7bd369cd150870";
logging-data="1994767"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+9foUA10FRP5q4tHaVtvLS"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.6.1
Cancel-Lock: sha1:Wx9oeJ8dhqFG/UBbXde2/b1WiGM=
In-Reply-To: <v2lhj7$1augh$1@dont-email.me>
Content-Language: en-US
View all headers

On 5/22/2024 12:38 PM, saito wrote:
> On 5/22/2024 3:32 PM, Rich wrote:
>> saito <saitology9@gmail.com> wrote:
>>> When you use a open/pipe command like [open "| xyz ...]", is it possible
>>> to configure it in both read and write modes? So I can write to it to
>>> send info to xyz and read its output?
>>
>> This is trivial for you to discover on your own:
>>
>
> You are right; give it to mental fog.
>
> Thank you.
>
>
>

I have been using the gemini AI (gemini.google.com) a lot more lately, since I was surprised by how well it knows Tcl coding.

I gave it the same question from your first post, and then I provided the text of this thread and asked it what it thought about it.

It then said:

"I'd be glad to provide a response that incorporates the best aspects of previous responses, addresses potential issues, and aims to be superior to a human response that might be dismissive:"

It followed that up with some info on buffering in tcl pipes, and a complete explanation of this thread's responses, and some recommendations.

The only thing it left out was,

I'll be back!

1

rocksolid light 0.9.8
clearnet tor