• open "|"

    From saitology9@21:1/5 to All on Wed Jul 26 15:54:16 2023
    When I run the following command from a terminal, I see the output.
    I wanted to put it in a proc. But the script gets no data.

    It may just be a Windows thing but if it is not, how do I make this work?

    % set f [open "|C:/Windows/System32/cmd.exe /Q /C ipconfig" r]
    % fconfigure $f -blocking 0 -buffering full

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From greg@21:1/5 to All on Wed Jul 26 13:22:12 2023
    saitology9 schrieb am Mittwoch, 26. Juli 2023 um 21:54:22 UTC+2:
    When I run the following command from a terminal, I see the output.
    I wanted to put it in a proc. But the script gets no data.

    It may just be a Windows thing but if it is not, how do I make this work?

    % set f [open "|C:/Windows/System32/cmd.exe /Q /C ipconfig" r]
    % fconfigure $f -blocking 0 -buffering full

    wiki: https://wiki.tcl-lang.org/page/How+to+run+external+script+from+Tk+and+make+it+throw+output+to+the+console%3F

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From saitology9@21:1/5 to greg on Wed Jul 26 16:37:38 2023
    On 7/26/2023 4:22 PM, greg wrote:

    wiki: https://wiki.tcl-lang.org/page/How+to+run+external+script+from+Tk+and+make+it+throw+output+to+the+console%3F



    Thank you. I think I am doing all of the steps there. I did not
    include it before but I also setup a readable handler right after.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Andreas Leitgeb@21:1/5 to saitology9@gmail.com on Wed Jul 26 22:01:32 2023
    saitology9 <saitology9@gmail.com> wrote:
    When I run the following command from a terminal, I see the output.
    I wanted to put it in a proc. But the script gets no data.

    It may just be a Windows thing but if it is not, how do I make this work?

    % set f [open "|C:/Windows/System32/cmd.exe /Q /C ipconfig" r]
    % fconfigure $f -blocking 0 -buffering full

    I gave it a try, and I noticed that after the open, a black window
    appears and immediately disappears... I'm pretty sure that this
    is the window of cmd.exe appearing and immediately taking ipconfig's
    output with it to the digital nirvana/afterlife.
    cmd.exe itself doesn't produce output, so that's why you don't get
    to see any input from the pipe.

    Try this instead:

    % set f [open "|ipconfig" r]

    or, if you don't want to rely on search path, then this one:

    % set f [open "|C:/Windows/System32/ipconfig.exe" r]

    This seems to do just what you seem to have expected.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From saitology9@21:1/5 to Andreas Leitgeb on Wed Jul 26 18:26:23 2023
    On 7/26/2023 6:01 PM, Andreas Leitgeb wrote:
    cmd.exe itself doesn't produce output, so that's why you don't get
    to see any input from the pipe.


    Thanks. Yes, I was doing some searching and this is the answer. It turns
    out that cmd itself generates no output. FYI, the /Q and /C were to
    turn off the windowing/interactive mode so it doesn't need user input
    and stay around afterwards. Your suggestions work fine.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)