info-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Java/CVS question


From: Eric C. Hein
Subject: Java/CVS question
Date: Tue, 11 Mar 2003 14:43:53 -0800

I'm using the java Runtime class to update files from a CVS repository and in some cases it is hanging (see comment in code).  I think this may have something to do with the buffer size for the standard input and output streams of the OS (Win2k).   If I close my java app the files do update correctly. Any ideas on how to resolve this?
 
Thanks
 
 
public String execute(String[] args) {
 
  StringBuffer result = new StringBuffer();
  String str;
  Process m;
 
  try {
 
   String [] cmd = {"cmd.exe","/c",args[0]};
   m = Runtime.getRuntime().exec(cmd);
 
   BufferedReader in =
    new BufferedReader(new InputStreamReader(
                               m.getInputStream()));
 
   while((str = in.readLine()) != null) {
    System.out.println(str);
    result.append("\n" + str);
   }
 
// *********** code hangs before it gets here ******************
 
   m.waitFor();
   System.out.println("Process exit code is:" + m.exitValue());
   
  }
  catch(Exception ex) {
   ex.printStackTrace ();
  }
  return result.toString();
 }

reply via email to

[Prev in Thread] Current Thread [Next in Thread]