I'm not sure what you expectation is here. The original script opens a pipeline to read the standard output of a process as if it were a file. When the original script writes to the standard output (using puts), then indeed the output is seen. When youchange the script to omit generating standard output, then you seen nothing. That's sorta what I would expect. Not clear to me what your expectations were.
Hello,
Following the advice there, I can call it like so:
set chan [open "|[list [info nameofexecutable]] C:/temp/sample.tcl" r+]
chan configure $chan -buffering line
gets $chan
And I can see the the printed output. However, if I change the
sample.tcl as follows,
return "Current time: [clock format [clock seconds]]"
then nothing is read from the channel.
Hello,
I have a question on the internal processing of command pipes in Tcl.
When you open a command pipe via [open "|..."' r+] and run a tcl script,
On 5/22/22 9:24 PM, mango wrote:you change the script to omit generating standard output, then you seen nothing. That's sorta what I would expect. Not clear to me what your expectations were.
I'm not sure what you expectation is here. The original script opens a pipeline to read the standard output of a process as if it were a file. When the original script writes to the standard output (using puts), then indeed the output is seen. When
Hello,
I was interested in capturing the return value, but using the spawning mechanism. But I see what you mean. Thank you.
| Sysop: | Keyop |
|---|---|
| Location: | Huddersfield, West Yorkshire, UK |
| Users: | 715 |
| Nodes: | 16 (0 / 16) |
| Uptime: | 169:26:18 |
| Calls: | 12,097 |
| Calls today: | 5 |
| Files: | 15,003 |
| Messages: | 6,517,837 |