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

  • Home
  • SEARCH
  • 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 8035631
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T02:21:51+00:00 2026-06-05T02:21:51+00:00

I recently started learning about IPC and I have some issues. I wrote a

  • 0

I recently started learning about IPC and I have some issues. I wrote a program that creates two processes which communicate through pipe like this:

#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <sys/types.h>
#include <unistd.h>


int main(void)
{
    int pfds[2];
    char buf[30];
    pipe(pfds);
    if (!fork()) 
    {
        printf(" CHILD: writing to the pipe\n");
        write(pfds[1], "test", 5);
        printf(" CHILD: exiting\n");
        exit(0);
    } 
    else 
    {
        printf("PARENT: reading from pipe\n");
        read(pfds[0], buf, 5);
        printf("PARENT: read \"%s\"\n", buf);
        wait(NULL);
    }
    return 0;
}

Sorry for not handling potential errors, I wrote it like this for simplicity.

This works great but my question is: Is there any possibility to have two programs – server/client(two separate executables – not parent process/child process relationship) that communicate through pipe? Just like you can through FIFOs?

Thank you!

  • 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-05T02:21:53+00:00Added an answer on June 5, 2026 at 2:21 am

    A regular pipe can only connect two related processes. It is created by a process and will vanish when the last process closes it.

    To communicate between two separate processes you must use named pipes (FIFO).

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

Sidebar

Related Questions

I just recently started learning Java. I have a question which is more about
Recently I have started learning rails and was a little surprised that the default
Recently, I started learning some Java. From what I've already learned about JVM it
I have recently started learning about Software as a Service and Cloud computing. Often
I just recently have started learning about the wonders of **kwargs but I've hit
Ok, so I've only recently started getting serious about learning how to program, and
I recently started learning perl and have a question that I'm not finding a
Recently I've started learning about Contexts in .NET (context-bound, context-agile, message sinks, etc.). Several
I started learning html recently, and one thing that really confused me is why
I recently started to use linux, so I have little knowledge about it. At

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.