Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9222741
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T03:54:22+00:00 2026-06-18T03:54:22+00:00

I need to execute an external program and access its stdin and stdout alternatively,

  • 0

I need to execute an external program and access its stdin and stdout alternatively, just like console terminal itself. I have used popen(), but it does not provide a bidirectional pipe. Using pipe() and fork() also does not work interactively, since the write pipe must be closed to access the read pipe.

Please give me some help to come up with it.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T03:54:23+00:00Added an answer on June 18, 2026 at 3:54 am

    You need to open two pipes, one that you connect to stdin of the child process, one that you connect to stdout. You probably also need some way to multiplex input/output in your process.

    Another option may be to use a pseudo-terminal, which will give you a two-way communication with the client software that has the pseudoterminal as it’s I/O channel – although I’m not quite sure exactly the steps you go through to do this, I’m just suggesting it as I know other programs, such as xterm and ssh uses that method.

    The same question has been asked before, and the answer is pretty much what I’ve described in the first paragraph:
    popen simultaneous read and write
    (This answer includes some code that looks OK!)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to execute a program and retrieve its stdout output in c++. I'd
I need to execute specific JavaScript instructions AFTER an external JavaScript finishes its own
I have a Python script that needs to execute an external program, but for
I want to execute a external .exe program from within java. The .exe is
I need to call an external program from Delphi 2006 code with a long
If I am in a situation where I need to execute external commands in
I need to execute Javascript from an external javascript library (which I left in
In the debug properties of my c# project I have selected Start External Program
Need to execute an external EXE from either a Java web app (running on
I need to execute and send command to external app from python: .\Ext\PrintfPC /p

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.