Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Runtime Process exec() method's default timeout method

 
Akshay Sahu
Greenhorn
Posts: 26
Java Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello All,

I wrote a shell script to move files from one folder to other. (Say folder1 to folder2 and say I am trying to move 2000 files)

Now when I am executing the shell script directly, I am able to move all the files from folder1 to folder2.
When I am executing the same shell script from a standalone Java Program (Runtime.getRuntime().exec()), even then I am able to move all the files from folder1 to folder2.

But whenever I am executing the same java program from within a servlet, I am able to move only 500-688 files at one stretch.

Can anyone help me with this ? Does any process, getting executed from JVM will have a default timeout period.

Thanks and Regards,
Akshay Sahu
 
Richard Tookey
Bartender
Posts: 1166
17
Java Linux Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm not aware of any Runtime.exec() timeout but of course you could be running into a Servlet timeout. If not then the chances are you are not avoiding the traps detailed in http://www.javaworld.com/jw-12-2000/jw-1229-traps.html but without a view of your code it is difficult to be certain.



 
lovely singh
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am new to java and wanted to know that how can i call c/c++ from java, and what should i do if i want to call all the library files in java by coding, even i want the c/c++ files should be compiled and executed. Actually i am making one java editor in which i can compile and execute the c/c++ code both , the GUI part is almost finished but having difficulty in calling them. Please some one help me.

Thanks in advanced
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic