[Top][All Lists]

[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?
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(
   while((str = in.readLine()) != null) {
    result.append("\n" + str);
// *********** code hangs before it gets here ******************
   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]