Home arrow static arrow Java Programming [Archive] - Problems with a thread that records dvd on suse linux
Warning: Creating default object from empty value in /www/htdocs/w008deb8/wiki/components/com_staticxt/staticxt.php on line 51
Java Programming [Archive] - Problems with a thread that records dvd on suse linux
This topic has 4 replies on 1 page.

Posts:10
Registered: 8/4/04
Problems with a thread that records dvd on suse linux  
Aug 4, 2004 6:29 AM



 
PLEASE HELP

I am using SuSE linux, and I record dvd+/- RW with the program growisofs.

By command line on the linux shell, growisofs records normally, but when I try to use the same line cone that I use in the shell in a java thread, it never stops recording, I mean, it records all data, but it apparently does not close the dvd session, for the grenn light on the drive never stops blinking, and I have to stop the proccess manually, because it never releases the dvd drive.

I use the thread in a large program, but for debugging this I have made a simple program, whose error is the same.

the code is:

String s = "/usr/local/bin/growisofs -speed=1 -M /dev/dvdram -V MIS27 -A growisofs -P MedImServer " +
" -p MedImServer -sysid Linux -J -R -l -relaxed-filenames -allow-lowercase -allow-multidot /windows/C/online";

Process p;

try {

p = Runtime.getRuntime().exec(s);

p.waitFor();
}
catch (IOException ex) {
JOptionPane.showMessageDialog(null,"erro no runtime");
System.exit(0);

}

catch (InterruptedException ex1) {

JOptionPane.showMessageDialog(null,"erro no waitfor");
System.exit(0);
}

with JBuilder 9 debug, I realized that it freezes at the moment of "p.waitFor()".

Please, I'm desperate!!!!

Any help WILL BE appreciated!

Thanks
Tiago

 

Posts:3,055
Registered: 18/06/98
Re: Problems with a thread that records dvd on suse linux  
Aug 4, 2004 6:47 AM (reply 1 of 4)



 
growisofs probably spits some messages to the screen when working, and you've not redirected the input and output streams of the program, thus causing it to malfunctioning.
Check the forum for some hints about getting the input and output streams and dealing with them properly.
 

Posts:10
Registered: 8/4/04
Re: Problems with a thread that records dvd on suse linux  
Aug 9, 2004 10:58 AM (reply 2 of 4)



 
No, because I use the recording in a larger program.
The code I sent before I used for debugging.
The code I use is the following:
            String cmd = "/usr/local/bin/growisofs " + speed + " " + modo + " " + dvdDevice + " "               +" -V " + prop.getIdMidiaAtual() + " -A growisofs -P MedImServer "               +"-p MedImServer -sysid " + os + " -J -R -l -relaxed-filenames -allow-lowercase -allow-multidot " + pathtmp;              p = Runtime.getRuntime().exec(cmd);             p.waitFor();              BufferedReader stdInput = new BufferedReader(new InputStreamReader(p.getInputStream()));            // L� saida do comando            while ( (s = stdInput.readLine()) != null) {                Log.info(GRAVA_LOG_MARK + s);            }            BufferedReader stdErr = new BufferedReader(new InputStreamReader(p.getErrorStream()));            // L� qualquer erro do comando            while ( (s = stdErr.readLine()) != null) {                Log.info("Processo de Grava��o: " + s);                if((s.indexOf("failed") != -1) || (s.indexOf("error") != -1) || (s.indexOf("unable") != -1)) {                   Log.error(mensagem + " " + s);                   prop.enviaMsg(mensagem + " " + s);                   throw new ExcecaoDistribuicao(ExcecaoDistribuicao.ERRO, mensagem + " " + s);                }            }        }        catch (IOException ex){            Log.error(mensagem + " " + ex);            prop.enviaMsg(mensagem + " " + ex);            throw new ExcecaoDistribuicao(ExcecaoDistribuicao.ERRO, mensagem + " " + ex);        }        catch (InterruptedException ex) {            Log.error(mensagem + " " + ex);            prop.enviaMsg(mensagem + " " + ex);            throw new ExcecaoDistribuicao(ExcecaoDistribuicao.ERRO, mensagem + " " + ex);        }


So, it is not that problem
 

Posts:10
Registered: 8/4/04
Re: Problems with a thread that records dvd on suse linux  
Aug 9, 2004 11:03 AM (reply 3 of 4)



 
I forgot to write at the prior post that I sent that resumed code before because the both codes have the same problem: apparently, the process does not return, even though all data had ben recorded.

Tanks
 

Posts:446
Registered: 10.03.2002
Re: Problems with a thread that records dvd on suse linux  
Aug 10, 2004 6:09 AM (reply 4 of 4)



 
Don't cross-post http://forum.java.sun.com/thread.jsp?forum=31&thread=545366&start=0&range=15#2652797
 
This topic has 4 replies on 1 page.