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 6965875
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T16:07:05+00:00 2026-05-27T16:07:05+00:00

I have one program that calls one tar.. something like popen(tar -zcvf) I want

  • 0

I have one program that calls one tar..
something like popen(“tar -zcvf”)

I want to write on the stdin… and get the output.. something like
tar -zcvf – /path| tar – zxvf –

so.. on one side i’ll encapsulate the files from the directory and them send trough the stdout and write on the inverse process.. and send to the stdout of the bash.

I want to do this pipe process..

Read one folder/file and send trought the stdin to the “extract” the content and read the binary output.

I want this, because i can send trought socket data and extract on the other side without the need of disk, i compress and decompress on realtime..

Someone can help me?

I saw i need to do a execl…
but all the examples i found was to redirect the stdout of the child to mine.

I will do something like that:

LOOP.
1 Get block of data from stdin
2 Send to child program
3 get the output
4 Do something with the data (send back trough socket)
END_LOOP

OR
LOOP
1 Get block of data from stdin.
2 Send to child program.
END_LOOP
LOOP
1 Get block of data from child program
2 Do something with the data (send back trough socket)
END_LOOP
  • 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-05-27T16:07:06+00:00Added an answer on May 27, 2026 at 4:07 pm

    You can’t use popen for this; popen is always unidirectional. You
    can set up something along these lines using pipe and fork directly
    (but it’s a lot more work than popen). If you do, however, you have
    to be very, very careful. A pipe can only hold a finite amount of data.
    Try to write more, and the write waits until the space is available. So
    you can easily end up in a situation where the child process is waiting
    for you to read something on its output pipe, in order to create more
    space in the pipe, and your process is waiting for the child to read
    something so that there will be more room in hhe pope. I’ve done this
    once in the past, but sort was one of the programs in the
    loop—and you’re guaranteed that sort won’t try to write anything
    until it has seen end of file on its input.

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

Sidebar

Related Questions

I have a program that only allows one instance of itself to run. I
I have an OpenGL program that works on all of my computers but one.
I am developing a C# program, and i have one function that consumes too
I'm almost finished with my program, but I have one problem that I can't
If I have a string formatting program in C, that consists of only one
I have to write a program that performs highly computationally intensive calculations. The program
I have a program that makes calls to an internal web API. However when
I have a C++ program called myArchive that calls routines from a static C
I have a program that does the following: Call webservice (there are many calls
I have a first form that calls another one and then disappears (frm.visible =

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.