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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T11:53:07+00:00 2026-05-13T11:53:07+00:00

I have 2 programs, both written in Java. The first launches several instances of

  • 0

I have 2 programs, both written in Java. The first launches several instances of the second and then communicates with them via pipe files. When running 2 instances of the program, (I’ll call the launcher A and the others B and C) everything works fine. The pipe files are in /tmp/[pid of A]/B and /tmp[pid of A]/C. If B or C close then other should keep on working, which it does except the entire /tmp/[pid of A] folder disappears.

The other program detects this and try to close itself because it shouldn’t work without the pipe files.

My questions are why does it keep working if the pipe files are gone? and why do they disappear in the first place?

If C closes then A and B keep on running. The only code that runs is System.exit(0); and except for processes messages received from the pipes A doesn’t do anything.

EDIT:

As per request the code that creates the directory and pipes.

File dir = new File("/tmp/" + pid);
dir.mkdirs();

File aDir = new File(dir, "A");
aDir.mkdirs();

File bDir = new File(dir, "B");
bDir.mkdirs();

Runtime.getRuntime().exec(new String[] {"mkfifo", PIPE_NAME}, null, aDir);
Runtime.getRuntime().exec(new String[] {"mkfifo", PIPE_NAME}, null, bDir);

The actual code is a little more complex but that is the basic idea.

When the program closes.

frame.addWindowListener(new WindowAdapter() {
  public void windowClosing(WindowEvent e) {
    System.exit(0);
  }
});

Reading and writing the threads is done in its own thread treating it as a normal file using BufferedReader and BufferedWriter objects.

  • 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-13T11:53:08+00:00Added an answer on May 13, 2026 at 11:53 am

    I can’t answer why the pipe file gets deleted, not enough information.

    I can answer why the program still works. In unix, deleting the name of a file from a directory does not delete the file. The file is only deleted when no more directory entries exist and the file isn’t in use by a program.

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

Sidebar

Ask A Question

Stats

  • Questions 266k
  • Answers 266k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Maybe PyQt works on Snow Leopard 64 bits. Look at… May 13, 2026 at 12:35 pm
  • Editorial Team
    Editorial Team added an answer Id say its more of Decorator... http://en.wikipedia.org/wiki/Decorator_pattern May 13, 2026 at 12:35 pm
  • Editorial Team
    Editorial Team added an answer In short, you've stated the standard conventions well and you're… May 13, 2026 at 12:35 pm

Related Questions

I've now written a few applications using scala actors and I'm interested in how
i want to have both an Apache and a Game Server to be reachable
The GString concept in Groovy is pretty powerful (see http://groovy.codehaus.org/Strings+and+GString ). GStrings let you
We're using Spring/Hibernate on a Websphere Application Server for AIX. On my Windows machine,
I have two programs written in C++ that use Winsock. They both accept TCP

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.