executing shell scripts
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Paul_Blattner
Posted On:   Friday, March 15, 2002 02:43 PM

I am porting a large engineerig aplication to Linux using Red Hat 7.2 anf Sun's 1.3.1_02 runtime environment. Much of the work is done by dynamically creating shell scripts, Runtime.exec() 'ing a chmod +x command to make the script executable, and then Runtime.exec() 'ing the script by name. This technique is necessary for large multi- command scripts and works fine on both Solaris and HP-UX. On Linux, however, the code that writes the script file never seems to "let go" of the file so the exec() always generates an error. When I try to access the script from a shell while the Java code is    More>>

I am porting a large engineerig aplication to Linux using

Red Hat 7.2 anf Sun's 1.3.1_02 runtime environment.


Much of the work is done by dynamically creating shell scripts,

Runtime.exec() 'ing a chmod +x command to make the script executable,

and then Runtime.exec() 'ing the script by name.


This technique is necessary for large multi- command scripts and

works fine on both Solaris and HP-UX. On Linux, however, the code that writes

the script file never seems to "let go" of the file so the exec()

always generates an error.


When I try to access the script from a shell while the Java code is

still running, I get a "Text file busy" message. This does not happen

in either Solaris or HP-UX.


Any ideas?

   <<Less

Re: executing shell scripts

Posted By:   Nathan_Meyers  
Posted On:   Tuesday, March 19, 2002 09:26 AM

Are you closing the file after you write it from the Java code?
About | Sitemap | Contact