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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T14:29:42+00:00 2026-05-22T14:29:42+00:00

What is the typical design for a program (such as a command line utility)

  • 0

What is the typical design for a program (such as a command line utility) to spawn an external editor and read back changes to the file? Many command line utilities do this. For example, svn commit launches an external editor to get the comment if it is run without -c.

Some options I have considered are:

  • Poll a temp file file, waiting for the timestamp to change, but this would be limited to a single save.
  • Register with the operating system to be notified of changes to a temp file, but this would would be platform dependent, which I’d like to avoid.
  • Monitor the spawned process, waiting for it to terminate, but I’m not sure how this would work for editors such as TextMate and TextWrangler that typically have long-lived processes.
  • Interact with the spawned process by stdin and stdout, but I’m not clear on the details of how/if this could work.

Hopefully the solution is platform independent. For the record my platform is the JVM on OS X.

P.S. Any advice on appropriate tags for this question?

  • 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-22T14:29:42+00:00Added an answer on May 22, 2026 at 2:29 pm

    If you launch a process through Java (Runtime.exec), you get a Process object back, which has a waitFor() method that will tell you when the process is complete.

    Just run vi or nano or whatever via that, and once it exits, you can read the file.

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

Sidebar

Related Questions

The typical ConfigParser generated file looks like: [Section] bar=foo [Section 2] bar2= baz Now,
I'm looking for help identifying this design pattern and learning the typical vocabulary it
In typical web design fashion, there's always something that doesn't look quite right between
Google File System Paper - Chunk size is one of the key design parameters.
What are the common design approaches taken in loading data from a typical Entity-Relationship
Typical way of creating a CSV string (pseudocode): Create a CSV container object (like
Typical approaches recommend reading the binary via FileStream and comparing it byte-by-byte. Would a
Typical jQuery over-use: $('button').click(function() { alert('Button clicked: ' + $(this).attr('id')); }); Which can be
A typical stored procedure in our system accepts around 20 or so parameters. There's
A typical approach to avoid two instances of the same script running simultaneously looks

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.