redirect « API « Java I/O Q&A





1. Start external executable from Java code with streams redirection    stackoverflow.com

I need to start external executable in such way that user can interact with program that was just started. For example in OpenSuse Linux there is a package manager - Zypper. You ...

2. Classic problem with executing external commands in Java?    stackoverflow.com

Okay - This one is a bit of a problem for a lot of folks - Since I have yet to see an answer that works, I thought I would express ...

3. (Java) File redirection (both ways) within Runtime.exec?    stackoverflow.com

I want to execute this command:

/ceplinux_work3/myName/opt/myCompany/ourProduct/bin/EXECUTE_THIS -p cepamd64linux.myCompany.com:19021/ws1/project_name < /ceplinux_work3/myName/stressting/Publisher/uploadable/00000.bin >> /ceplinux_work3/myName/stressting/Publisher/stats/ws1.project_name.19021/2011-07-22T12-45-20_PID-2237/out.up
But it doesn't work because EXECUTE_THIS requires an input file via redirect, and simply passing this command to Runtime.exec doesn't ...

4. How to tell if command line arguments contain a stream redirection    stackoverflow.com

I am writing a program that takes one action if the command line contains a stream redirection, such as > or <, but takes another action otherwise. My first instinct was to ...

5. How to redirect an OutputStream    coderanch.com

I'm a bit confused on what you are asking. Are you wanting to take what you are printing to the standard output and write that to a file, also? When you write to a stream, especially with autoflush on, the data doesn't hang around to be reused. So let's say you use your PrintStream to write "Hello World!" (which will go ...

6. How to Redirect OutputStream to a String / StringWriter    coderanch.com

Hi I am having a channel i am communicating remotely to execute Unix commands. I would like to know how do i give an OutputStream reference to that actually rights to a StringWriter. Currently using channel.setOutputStream(System.out); This displays the output on console, but i want to write it to a String / StringBuffer / StringWriter. Let me know if you have ...

7. Redirect error and output stream using java program    forums.oracle.com

I'm facing following problem: 1. I have a Java program which calls other java program. 2. I call the other java program by: ---> I run the batch file. Process proc =Runtime.getRuntime().exec(batchFile); ---> This batch file calls the java program. Now In my main application that is main java program I'm capturing error and output stream of DOS command line so ...

8. I am missing something regarding redirection and Stream    forums.oracle.com

This is not a vague question at all. My desire is to allow a user of my program at their leisure to run the program and provide input from the keyboard. The program will obviously, for simplicity sake, use Scanner. Now if the user happens to have multiple input they do not want to type into the console using their keyboard, ...