Java Runtime.exec - can you read the output interactively?

I am running a program never ends, its a text based download manager. It gives output on ONE line, and this isnt in std.out (im using unix).
this continues (basically it just gives you a view of how much progress the file is downloading.
Is there a way to read this from java?
cheers.

try
{   // Execute command
    String command = "aCommand";
    Process child =  Runtime.getRuntime().exec (command);
    // Get input stream to read from it
    InputStream in = child.getInputStream();
    int c;
    System.out.println("Command returns ");
    while ((c = in.read()) != -1)
        System.out.println("---"+((char)c));
    in.close();
catch (IOException e)
     System.out.println("Exception occurred: "+e);
}

Similar Messages

  • Can you read the iPad in the sun?

    can you read an ipad in the sun? DOes the anti glare screen protector make it easier?

    I found this from the More like this box on the right.
    I use the screen cover from this site http://www.powersupportusa.com/accessories/ipad-2/hd-anti-glare-film.html
    works great, but I won't lie and say it's a 100% but it's the best I've found to combat the glare from direct sun.
    I have a very difficult time using my iPad in bright sunlight with no anti glare screen protector on it. Here are some more that you can check out.
    http://www.google.com/search?q=anti%20glare%20screen%20protectors%20for%20iPad

  • Can you tell the output type within template?

    Hi all,
    we're using Oracle apps 11.5.10 and we have the usual leading zero problem when exporting to Excel.
    From what I've read, Excel uses the 'TypeGuessRows' registry setting to read through a specify number of rows to decide whether a column is numeric and then drops the leading zeros. I've also seen the proposed solution of putting a quote mark to trick Excel. We have a requirement to display the right numbers including leading zeroes in both PDF and Excel. So now I'm down to 2 choices.
    1) create a separate template for PDF without the quote or my question
    - Within a template, can you tell what the runtime output type is? Does the XML Publisher engine provide a way to obtain this value within a template?

    Hi Mike,
    I used
    <fo:bidi-override direction="ltr" unicode-bidi="bidi-override"><?D_INVOICE_NUM?></fo:bidi-override>
    and it still didn't work. The invoice number is alphanumeric an sometimes just contains numbers with leading zeroes which is what I'm testing with.
    Cheers
    Kofi

  • Can you change the output slide size in Captivate 7?

    Hello,
    I am looking to change the defualt size of the slides when a project is published into a word doucment. I have seen this done before, but I cannot find any information on this process. I know it needs to be done in a Captivate folder and not in the project it self.
    Thanks!

    Nevermind, I found it in the Adobe Captivate folder under Gallery\Printoutput. From there you will have 3 different word docs, Lesson.doc Step by step.doc, and Stroyboard.doc. You make the change desired output document.

  • Can you change the output resolution on appletv 2

    HAving issues seeing video on a runco 61 " plasma with vivx processor. Also using hdmi to dvi converter. I want to change from 720 p. Is it possible ? In the apple menu there is an option for hdmi out that wont change from auto.

    The Apple TV only supports TV's that accept 720p, they also don't support DVI but may well work in some cases with DVI.
    The Auto setting for HDMI isn't what you think it might be its for switching between RGB and Y'CbCr

  • Read the output of the iseries CL Program from Java

    I have a Java program running on the iseries(AS400). I need to call a CL program from this JAVA.I have to pass 7 arguments to it.Out of 7, three are input parameters to CL and other 4 are its output parameters to the calling JAVA program. I am using Runtime.getRuntime().exec(arguments) to call the CL. Please suggest me how to read the output from the CL in the JAVA program.

    http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html
    Kidding:
    If a method has at least 7 parameters, chances are one or two have been forgotten.

  • Java arrays - can you name the keys?

    i have 1 function that declares 2 ArrayLists of type String. They are the same size and the values are related. Let's call them A & B.
    I was hoping i could have my function return just 1 array, with the values of arraylist A being they keys of the returned array, and the values of arraylist B being the values in the returned array.
    But can you name the elements of an array in java? in php you can, but in java, the only examples i have seen only use the standard #'s: 0, 1, 2, 3, etc. if you can, please post sample syntax.
    i guess i could use a double scripted array, but... well i don't exactly know what the sytax would be for that in declaring the funciton.
    if someone has a link of these kinds of examples / topics they could send me - that would be great too - i googled it but haven't really come across any.
    thanks in advance

    It appears as though what you are trying to do is associate a specific "key" value with another value. For example, let's say you want the word "dog" to be the key for the arraylist value of "bull dog."
    The perfect data structure for this that Java provides is called a Map. Here is some sample code.
    //create something called a HashMap where the first
    //value is the key, and the second value is the value
    //that the key is associated with
    HashMap<String, String> map = new HashMap<String, String>();
    //now, consider the previous example...
    //here is the syntax for storing those values
    map.put("dog", "bull dog");
    //and this would be the syntax for getting a value
    String value = map.get('dog");
    //which would give "bull dog"
    {code}
    Hope that helps :)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Can you change the color of the links in FM HTML5 Output?

    I edited the style mapping in FM and it didn't work. I edited every CSS I can find in the output folders and subfolders (by opening in Notepad). The links are all still blue. Any ideas?

    I figured out how to do it. My FM book has four chapters. My hypertext links and cross references are formatted with a character style named link. When creating the HTML5 output, FM made a folder for each chapter containing (among other things) a css file for the chapter. I added the the span and the link definition see below) to the css for each chapter (adding it to main.css or jqueryui-custom.css did not work). I'm happy that it works, but it means that I need to add it to the css after generating the HTML5 output (FM overwrites the css files every time you generate the output). If anyone has a better idea, I'd love to hear it!
    span.FM_link {
            font-style:      italic;
            font-weight:     bold;
        color: #4c4c4c;
            text-decoration :  none  ;
            letter-spacing:  -0.03em;
    A:link {
        color: #000000;
        text-decoration: underline;
    A:visited {
        color: #3a3a3a;
        text-decoration: underline;
    A:hover {
        color: #000000;
    A:active {
        color: #000000;
        text-decoration: underline;

  • What do you do when you can't read the code on a iTunes gift card?

    What do you do when you can't read the code on a iTunes gift card? I tried taking it back to the store with my reciept, but they said I would have to contact Apple support. Am I out just out $25 dollars?

    See this support article:
    http://support.apple.com/kb/TS1292
    Instructions are at the bottom of that article.
    BTW, this forum is for questions about iTunes U, Apple's service for colleges and universities to post educational material in the iTunes Store. Normally you want to ask your questions in the general iTunes forums.
    Regards.

  • Can you read books on the ipad in direct sunlight

    can you read books on the ipad in direct sunlight ?

    Not very easily no. If you can get a non-reflective screen cover it might be a bit better, but it probably still won't be as good as, for example, a Kindle device is.

  • Can you put the audio to work throughout the reading of the chapter? Today, when I change the page, the audio stops

    Can you put the audio to work throughout the reading of the chapter? Today,when I change the page, the audio stops

    The default action is as you've noted. Audio stops when navigation to another page,
    iBA doesn't offer a way to do differently, sorry.
    Ken

  • Can you operate the mac book pro 15 inch with out the battery?  I read somewhere in a post that it lowers the power to about 1 gig.  I asked apple and they said it is not true because you can use it with or without both together without affecting op pw

    can you operate the mac book pro 15 inch with out the battery?  I read somewhere in a post that it lowers the power to about 1 gig with out the battery.  I asked apple and they said it is not true because you can use the comp with the power adapter and battery together or either by itself and it will not effect the 2.16 gig.  Thank you.

    If you remove the battery the CPU power will be cut by 50% (whatever they told you) so that there's no lack of power or overheating issues. It's best to always keep the battery in.

  • How/where can you change the delimiters within the output file -Urgent Pls!

    Hello Experts,
    When Exporting data through EAS, how/where can you change the delimiters within the output file (ie. space delimited vs tab delimited vs custom)
    Thanks in advance.
    Regards,
    Sonu

    This is where I will be shot down in flames but at least in 7.x I am unaware of any configuration option that allows you to export in anything other than space delimited.
    I guess you could write a shell/perl script that could change this outside of Essbase
    Edited by: DrFosterMan on Jan 16, 2009 12:54 PM

  • Can you play the guitar program and also run a keyboard at the same time using seperate outputs for both?

    I wanted to be able to play live on my electric guitar using mainstage and my keyboard player to use mainstage on the keyboard can this be done using the mainstage 2 on this computer?  Also if this can be done can you send the keyboard output and the guitar output seperatly to be able to be in different channels in the PA system?

    Hi
    Spatrick79 wrote:
    I wanted to be able to play live on my electric guitar using mainstage and my keyboard player to use mainstage on the keyboard can this be done using the mainstage 2 on this computer?
    Short answer: YES (but you will need to carefully consider how you organise your Patches with Guitar and Keys combinations, so that you both get the correct sounds at the same time)
    Spatrick79 wrote:
    Also if this can be done can you send the keyboard output and the guitar output seperatly to be able to be in different channels in the PA system?
    Yes, ideally using a multi-output audio interface. edit (with 2 outs for the guitar, and 2 for keys... you might also want another 2 pairs for monitoring)
    CCT

  • Can you put the labview runtime engine in a vi?

    hello,
    can you put the labview runtime engine in a vi when you build an application or do you need to install it separately on each computer that is going to run a labview application?  thank you

    I found the tutorials in labview help pretty good
    Example: Building a Stand-Alone Application
    Example: Building an Installer (Windows)
    This certainly got me started working with the project explorer to build and deploy your application.
    Hope this helps
    David

Maybe you are looking for

  • Missing Lensprofiles from SONY and ZEISS in Camera Raw

    Hello, A few months ago I switched from Canon to Sony and Carl Zeiss and ever since I am missing some lens profiles in Camera Raw. I'm a picture editor and of course miss this opportunity of pre-correcting the lens profiles in the RAW development. I

  • Font in movie not displaying correctly

    Take a look at BPI. The font in the slide show is supposed to be displaying as "Verdana" and is instead displaying as Times New Roman it appears. I could swear that when I first created this file the font displayed correctly. Can anyone tell me what

  • New report requirement

    Hi Experts, How to design the report for Finished and Semi finished goods on 0IC_C03 cube on daily basis, Wt are the objects i have to use in this report, please give the suggestions and help to do this... Help full answer will be awarded with points

  • Global working Command-Box in Bex Analyzer

    Hallo everybody, i have the following Problem in creating a Planning book in Bex-Analyzer (Excel): My Problem is to allow the user to add to every Attribute a comment field in a Bex Analyzer Workbook witch is global available to see. That means that

  • Problems viewing embedded flash videos

    About 2 weeks ago I had the error message while on Youtube that I needed to update my flash software. I did so and since then I can't see any videos that are embedded on websites. I can see them if I click on the direct link only and it pops up the y