Hi, Ant 1.6 adds a tempdir attribute to the Javac task. You can use that to se the tempdir via Ant or in the DefaultCompilerAdapter. You will need to run with Ant 1.6 or later obviously, and also have a custom version of DefaultCompilerAdapter. If you'd like your enhancement to be ported into the main tomcat code, please submit an enhancement issue to Bugzilla with the .diff that includes the new compiler option.
Yoav Shapira Millennium Research Informatics >-----Original Message----- >From: David Cassidy [mailto:[EMAIL PROTECTED] >Sent: Tuesday, September 14, 2004 10:52 AM >To: Tomcat Developers List >Subject: Tomcat 4.1.30 (although its still there in tomcat 5.0.28) temp >file issue. > > >Guys, > >We run an internal mass web hosting platform for our clients. >In order to protect them as much as poss we make their areas read only. >We set the normal java.io.tmpdir to be a writeable area. > >We've hit an issue at the moment where sometimes under certain conditions >the >DefaultCompilerAdapter gets called. This seems to think that as >getJavac().getTempdir() >has returned null (if anyone knows how to get the tempdir set please let me >know) >it should write its temp file in the users home dir. >The users home dir is read only. > >How do i set what ever it needs to write the temp file in the right place ? >I've set the scrachdir for org.apache.jasper.servlet.JspServlet >but still to no avail. >Or failing that could not > > > protected int executeExternalCompile(String args[], int firstFileName, >boolean quoteFiles) > { > String commandArray[]; > File tmpFile; > commandArray = null; > tmpFile = null; > if(Commandline.toString(args).length() > 4096 && firstFileName >= >0) > { > PrintWriter out = null; > try > { > File userDir = getJavac().getTempdir(); > if(userDir == null) > { > String userDirName = System.getProperty("user.dir"); > userDir = new File(userDirName); > } > tmpFile = fileUtils.createTempFile("files", "", userDir); > tmpFile.deleteOnExit(); > > >be written as > > protected int executeExternalCompile(String args[], int firstFileName, >boolean quoteFiles) > { > String commandArray[]; > File tmpFile; > commandArray = null; > tmpFile = null; > if(Commandline.toString(args).length() > 4096 && firstFileName >= >0) > { > PrintWriter out = null; > try > { > tmpFile = java.io.File.createTempFile( "files", ""); > tmpFile.deleteOnExit(); > >Thanks >david > > >-- > >This e-mail may contain confidential and/or privileged information. If you >are not the intended recipient (or have received this e-mail in error) >please notify the sender immediately and destroy this e-mail. Any >unauthorized copying, disclosure or distribution of the material in this e- >mail is strictly forbidden. > > > >--------------------------------------------------------------------- >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] This e-mail, including any attachments, is a confidential business communication, and may contain information that is confidential, proprietary and/or privileged. This e-mail is intended only for the individual(s) to whom it is addressed, and may not be saved, copied, printed, disclosed or used by anyone else. If you are not the(an) intended recipient, please immediately delete this e-mail from your computer system and notify the sender. Thank you. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]