I thought maybe the thread group would have a little more insight about my problem. I'm trying to write little script that automates two unix (now OS X) programs mplayer and lame. In theory, mplayer will download the appropriate files I tell it to and then lame will encode them from WAV to MP3. Both of the two previous functions (mplayer and lame) work great when I run them from a command line.
Now here's the thing, I tell java to execute the mplayer command using runtime.exec(). It begins the execution which should take a long time, as it is downloading a stream of audio, but then without missing a beat moves on and terminates my script application as if all went well. I used a BufferedReader to get the output from mplayer (really from the runtime object), and it spits me back the first 6 lines almost exactly as I get when I run mplayer directly from the command line. But I do not get the rest of it, which should be another 50ish lines. The code follows, pardon the ugliness of variable names.
any ideas are GREATLY appreciated
posted 11 years ago
You should read more about runtime.exec() and Process.
In the process you have an option to wait for exit value of the process. Under unix (or OSX) you whould usually get 0 for all good and 1 for error. So try to get the exit value and evaluate it.