Calling another program and waiting for output

Hi,
I'm writing a program that passes a file created for an application called Net Sim but has to wait for the output. Net Sim lies in another directory from the java files and I don't know how to call the program with the file created as a parameter, such as:
ns2 network1.tcl
where 'ns2' is the dos command to run net sim and 'network1.tcl' is a file passed as a parameter to the program.
I've tried
try{
Runtime r = Runtime.getRuntime();
r.exec(" <directory> ");
}catch(IOException e){
System.out.println("Error " +e);
This doesn't work though and I could use some help, as well as how to save the file created by the program in another directory.
Finally, I need to know how to make the program wait for the output from net sim which is a file I intend to use. Can I do this with a while loop etc.?
I thank you in advance for any help,
Regards,
Gary.

Here's an article from JavaWorld describing some of the pitfalls when using Runtime.exec() that might help you:
http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html

Similar Messages

  • 1.call information such as call waiting,call forwarding, call holding is not working when caller the call me or im wait for my call i cant see any title by iphon , and also holding is the same.2. there is not any option for call baring.

    Hi. please solve my problem.
    .call information such as call waiting,call forwarding, call holding is not working when caller the call me or im wait for my call i cant see any title by iphon , and also holding is the same.2. there is not any option for call baring.3.playback music is not hearing by second partner during the call.4.i cant select ringing ton from saving tons.
    thank you in advance.

    Hi Ersin,
    Exception 1 would seem to be FORMATTING_ERROR, which suggests something in the design of the Smartform.  However, that doesn't fit with the form being generated from a report, but only erroring when called from a function module.  I can think of no reason why the different calling method would be a factor.
    When FORMATTING_ERROR is raise it should also set a message ID and number, are you able to determine what they are?
    Regards,
    Nick

  • Standard script and code for output control ticket in IW32

    Hi,
    I am working on a output control ticket which gets printed using transaction IW32.
    I have to create Z driver program and z form and attach it to shop paper.
    I just wanted to make sure that RIPRCT00 and PM_COMMON are the standard program and form for this output control ticket.
    Because even though if I keep a break point in the program RIPRCT00 to see the data its fetching, when I do the print preview after going in IW32 I don't go inside the standard program RIPRCT00.
    So I am wondering if RIPRCT00 and PM_COMMON are the standard prohgram and form attcahed with output control ticket ?

    You must enter something in the form.  The reason for this is because in the program when it is going to execute the print of the papers, it is call the subroutine(form) of the print program.  It gets these values from your configuration in SPRO.  It is doing something like this.
    perform print_paper in program zriprct00.
    Of course, "print_paper"  and "zriprct00" are variables retrieved from the configuration.
    So, in summary,  In SPRO,  configure the output type to use the PRINT_PAPER form of program "ZRIPRCT00" and the sapscript form ZPM_COMMON. 
    If you are developing a completely new "Z" print program, you must have an entry point in which the program is executed.  You will have to have a subroutine(form) very simular to PRINT_PAPER,  or you can just copy and paste that code into your new program. 
    Make sense?
    Regards,
    Rich Heilman

  • How to do custom dialog so it displays the dialog and waits for user to end

    I have an application that I want to create my own dialog screens. For example, the user cliks on one frame, and I want to open a window for the user to enter data, after the user finishes, he presses OK and then the main app continues.
    On the class that I open the dialog, I open it with:
    NewOkCancelDialog.abrePopup();
    System.out.println("Program should wait for the dialog to close");And the 'NewOkCancelDialog' class is defined like:
    public class NewOkCancelDialog extends javax.swing.JDialog {
    The constructor is like:
    public NewOkCancelDialog(java.awt.Frame parent, boolean modal) {
    super(parent, true);
    initComponents();
    this.setLocation(400,400);
    This methods are when the user activates the button and the popup closes..
    private void cierraPopupOk(){
    resultados.setciudad1(this.fld_ciudad1.getText());
    if (resultados.getciudad1length() < 3) {
    System.out.println("Error en la entrada!");
    } else {
    doClose(RET_OK);
    private void okButtonActionPerformed(java.awt.event.ActionEvent evt) {                                        
    cierraPopupOk();
    private void doClose(int retStatus) {
    returnStatus = retStatus;
    this.estaAbierto = false;
    setVisible(false);
    dispose();
    I would like to have the application in the first lines, after calling
    NewOkCancelDialog.abrePopup();
    to wait until the method doClose() in NewOkCancelDialog class is finnished. But right now, after the ...abrePopup() is called, it continues.
    What am I doing wrong? or what am I not doing?

    Use the "code" tags not the "bold" tags when posting code.
    But right now, after the ...abrePopup() is called, it continues.Well your posted code doesn't show this method so we don't know what you are doing in this method.
    Why are you using a static method to show the dialog? Normally the code would be:
    JDialog dialog = new CustomDialog();
    dialog.setVisible( true );
    But you are correct with the basic idea in that you need to use a modal dialog.

  • Want the program to wait for some sec

    Hi,
    I'm trying to get a kinda sweeping effect with a couple
    of images. I need the program to wait X amount of
    millisec before it shows another image.
    How can I do this? I've tried using sleep and delay
    but I can't get it to work. I'm not using any threads.
    I just want the program to wait for a moment.
    Thanx

    try {
    Thread.sleep(millis);
    } catch (InterruptedException e) {
    }

  • Calling another program

    Is it possible to call another program (vlc media player in my case) in a VI???I dont want to use the Active X control for playin videos as it does not have much playback functions...

    Use the System exec.vi to launch any executable from LabVIEW in your case VLC player.  Provide the required inputs path, command line args so that you can obtain the desired functionality.
    With regards,
    JK
    (Certified LabVIEW Developer)
    Give Kudos for Good Answers, and Mark it a solution if your problem is solved.

  • Calling another program from the current program

    Hi all,
    In our requirement we are calling another program from our current program .
    In the current program( from which we are calling ) we are giving file name in the selection screen
    and when we run the current program we are successfully going to other program but our main requirement is to higlight the file name which we had given earlier .
    Note :  The called program doesnt have any selection screen.

    HI
    use EXPORT and IMPORT key words for passing data from one program to another program.
    as the called program is available in the same session you can use above key words which means you are accessing ABAP MEMORY.
    You can also use SET and GET key words which means SAP memory
    take F1 help there are examples tooo and detailes explanation abou the same
    Regards
    Ramchander Rao.K
    Edited by: Ramchander Krishnamraju on Dec 24, 2008 7:05 AM

  • I have to select a file – get Info – and change – open with and change from preview to another program and CHANGE ALL everytime I boot up

    Why do I have to select a file – get Info – select – open with – and change from Preview to another program and click CHANGE ALL with every file extention everytime I boot up.

    Back up all data.
    This procedure will unlock all your user files (not system files) and reset their ownership and access-control lists to the default. If you've set special values for those attributes on any of your files, they will be reverted. In that case, either stop here, or be prepared to recreate the settings if necessary. Do so only after verifying that those settings didn't cause the problem. If none of this is meaningful to you, you don't need to worry about it.
    Step 1
    If you have more than one user account, and the one in question is not an administrator account, then temporarily promote it to administrator status in the Users & Groups preference pane. To do that, unlock the preference pane using the credentials of an administrator, check the box marked Allow user to administer this computer, then reboot. You can demote the problem account back to standard status when this step has been completed.
    Triple-click the following line to select it. Copy the selected text to the Clipboard (command-C):
    { sudo chflags -R nouchg,nouappnd ~ $TMPDIR.. ; sudo chown -Rh $UID:staff ~ $_ ; sudo chmod -R u+rwX ~ $_ ; chmod -R -N ~ $_ ; } 2> /dev/null
    Launch the Terminal application in any of the following ways:
    ☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.)
    ☞ In the Finder, select Go ▹ Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens.
    ☞ Open LaunchPad. Click Utilities, then Terminal in the icon grid.
    Paste into the Terminal window (command-V). You'll be prompted for your login password, which won't be displayed when you type it. You may get a one-time warning not to screw up. If you don’t have a login password, you’ll need to set one before you can run the command. If you see a message that your username "is not in the sudoers file," then you're not logged in as an administrator.
    The command will take a noticeable amount of time to run. Wait for a new line ending in a dollar sign (“$”) to appear, then quit Terminal.
    Step 2 (optional)
    The first step should give you usable permissions in your home folder. This step will restore special attributes set by OS X on some user folders to protect them from unintended deletion or renaming. You can skip this step if you don't consider that protection to be necessary.
    Boot into Recovery by holding down the key combination command-R at startup. Release the keys when you see a gray screen with a spinning dial.
    When the OS X Utilities screen appears, select
    Utilities ▹ Terminal
    from the menu bar. A Terminal window will open.
    In the Terminal window, type this:
    resetpassword
    That's one word, all lower case, with no spaces. Then press return. A Reset Password window will open. You’re not  going to reset a password.
    Select your boot volume ("Macintosh HD," unless you gave it a different name) if not already selected.
    Select your username from the menu labeled Select the user account if not already selected.
    Under Reset Home Directory Permissions and ACLs, click the Reset button.
    Select
     ▹ Restart
    from the menu bar.

  • How do I reinstall Adobe Acrobat XI Pro from the Creative Cloud? I was deleting another program and accidently deleted Acrobat.

    How do I reinstall Adobe Acrobat XI Pro from the Creative Cloud? I was deleting another program and accidently deleted Acrobat.

    Sweetmelissa63 for information on how to reinstall Adobe Acrobat XI Professional please see CC desktop lists applications as "Up to Date" when not installed - http://helpx.adobe.com/creative-cloud/kb/aam-lists-removed-apps-date.html.

  • Bought Premier Elements yesterday. EVERY time I try to open a set of clips with Editor, I am told I have to sign into my Adobe first. I do this and wait for several minutes for the password dialogue box to open, enter my password. then wait and wait until

    Bought Premier Elements 13 yesterday. EVERY time I try to open a set of clips with Editor, I am told I have to sign into my Adobe first. I do this and wait for several minutes for the password dialogue box to open, enter my password. then wait and wait until my pw is recognized. Accept agreement. Agreement screen disappears and I'm back where I started. Try to open video clips with editor again and get the same demand to log in. Please advise asap. thx

    Oldcameraman
    Please do not duplicate a thread. The threads are answered as soon as possible. We are not Adobe. Just user to user.
    I have answered your most recent of the duplicates
    Premier Elements 13 Organizer Works. Editor doesn't. Log in doesn't work
    It is uncertain just how far we can go to help you since you do not appear to have Premiere Elements any
    longer.Seems you demanded a refund from Adobe Chat, got it, and now are left with a non purchased program which I
    am not sure can be used.
    Duplicates tend to confuse the person asking the question as well as those attempting to reply. As I suggested in the
    above mentioned thread, try to sort out your situation with Adobe via its Adobe Chat.
    ATR

  • I have two hard drives on my mac 10.5.8 power pc and hear the clickking sounds of the first hard drive and think that it may be dying, can I install everything on the other hard drive also and wait for the first drvie to die before i use the other drives

    I have two hard drives on my mac 10.5.8 power pc and hear the clickking sounds of the first hard drive and think that it may be dying, can I install everything on the other hard drive also and wait for the first drive to die before i use the other drives? Or, what is the best way to handle this?

    I do not know what you are waiting for.
    I'd make a backup of your important stuff before cloning the entire disk.
    Carbon Copy Cloner will copy your startup drive to an external  firewire drive.  You can boot from the external drive to verify that you have a good clone. When you upgrade your existing startup drive, you can at any time boot from your external drive and go back to your existing system.
    http://www.bombich.com/software/ccc.html
    SuperDuper is the wildly acclaimed program that makes recovery painless, because it makes creating a fully bootable backup painless. Its incredibly clear, friendly interface is understandable, easy to use, and SuperDuper's built-in scheduler makes it trivial to back up automatically. And it runs beautifully on both Intel and Power PC Macs!

  • HT4972 I am trying to update ipod touch from ios 4.3.2 to ios 6.1.3.  I have it connected to my computer, and the summary in itunes indicates the update is available.  However, when I click "update", it opens Windows Explorer and waits for a file name to

    I am trying to update ipod touch from ios 4.3.2 to ios 6.1.3.  I have it connected to my computer, and the summary in itunes indicates the update is available.  However, when I click "update", it opens Windows Explorer and waits for a file name to open.

    I am not at that computer now, but I did check via windows update & with the check updates menu choice in the itunes program  - neither indicated a newer version of itunes is available. (it is a vista computer).
    The itunes software on the computer displays my ipod & the current ios (4.3.2), and indicates a newer ios is available (6.1.3). When I choose "update", I am taken to Windows Exploer and prompted to choose a file to open. it is as if the "update" button has the incorrect code attached to it.
    The ipod is working, but there are several app I would like to install, but I can't with the current ooperating system.

  • LV PDA 8 wait for ms and wait for next N ms multiple costs extrem performance.

    Dear LV PDA users.
    There is another bug using the PDA toolkit.
    The usage of wait for ms and wait for next N ms multiple costs me 200ms while the input is 1ms.
    I have tried it without the wait functions and the looptiming was 0..1ms.
    One possible workaround is to use timout events with while loops.
    This works fine without delays.
    With kind regards
    Martin Kunze
    KDI Digital Instrumentation.com
    e-mail: [email protected]
    Tel: +49 (0)441 9490852

    This issue has already been reported to the R&D group at NI (at least that is what I'm told) ...  refer to this thread ... Here

  • "Waiting for output formatter"

    Printing to network printers through a spool server has stopped working. Local front end printing still works fine but anything sent to one of the network printers waiting for spool server with the status text "Waiting for output formatter". There are plenty of spool processes waiting and no errors. Its a system recently upgraded to ERP2005 but has worked since for a month.

    Chris Soden wrote:>
    >  One thing I have noticed in the spool system settings in SPAD the last spool scan on the spool server was yesterday just before the printing stopped.
    Hi Chris,
    I don't think this is the reason. Can you please check the logs of the spool requests and post them here?
    Regards
    Juan

  • Printer delay - Waiting for output formatter

    Hello,
    since 2 days, our print outs out of SAP take up to 10 minutes before the actually get printed out.
    In SP01 it says "waiting for output formatter".
    - I checked table TSP01and it only has 800 entries.
    - When I do a reprint for the delayed print out, it is printing out right away with no delay.
    Any suggestions?
    Thanks
    Anne

    We found the issues, so for the record:
    A couple of print jobs have been sent to one printer and got stuck. The person using this printer is on vacation so nobody noticed. However after the printer has been turned off and back on, the print outs came out and the print speed for all other prints went back to normal.
    Seems like this one printer was holding up all other prints.

Maybe you are looking for

  • Dispaly setting in web dynpro abap

    Hi expart, My required is i want to display the data in TABLE and i change the dispaly setting for the output table . path is   setting->HIDE GROUP  i  want to  change  this properties. THANK'S AND REGARD'S. VIKASH.

  • Move photos, music, time machine

    I would like to move my iphoto library, itunes library and time machine off of my current i-mac.  What is my best solution?  I love that my ipad and iphone sync with my computer when i walk in the door, if I move the libraries to an external drive wo

  • Revaluation in Retail

    Dear all, I'm setting up the logistics extraction in a retail environment. For Revaluations, standard BC infosources & data sources are available. Can somebody please tell me what the difference is between 2LIS_03_UM and 2LIS_40_REVAL? Should I use b

  • SEARC HELP

    Hello Friends, Need help on search help,I am doing a report in which the selection screen has 2 select options 1)Sales Order No ,2) Material Number Now what I want is that if the user enters the sales order no and then presses F4 for material number

  • Is it bug for adobe air on ios??

    I am checking for the Loader class on the ios platform.Surprisingly I am never able to load any transparent png as tranparent, a white background is always added to that when i load image from the CameraRoll using loadFilePromise() method of loader.