Hi Maha, when you had this problem with the FileWriter were you running a remote
job (as opposed to
a local job?). If you were running a remote job then it is intended that it
should fail, since otherwise your file would be created on the remote server. We
have added some facilities to make it easier to log output from remote jobs in
the new release of JAS.
If you wre having this problem even when running locally let me know and I will
look further into it. It did appear to work for me with a local job on Solaris.
I have been able to reproduce your other problem with reading StdHEP files on
Solaris and am still working on a fix for it.
Tony
Mahalaxmi Krishnamurthy wrote:
> Hello All ,
> I have been trying to write the out put on to a file and it keeps
> giving me errors
> the code i am using is :
>
> // Example of writing to an output file from a JAS event anlyzer
> import hep.analysis.*;
> import java.io.*;
>
> final public class IOExample extends EventAnalyzer
>
> {
>
> private PrintWriter out_file;
> // Define print stream object
>
> public IOExample()
>
> {
>
> // Enter constructor code here.
>
> }
>
> public void beforeFirstEvent()
>
> {
>
>
>
> // Define output file
>
> try
>
> {
>
> out_file = new PrintWriter
>
> (new BufferedWriter
>
> (new
> FileWriter("/amd/phys150/home/kmaha/lcd/")));
>
> }
>
> catch (IOException error) {out.println("File not opened");}
>
> }
>
> public void afterLastEvent()
>
> {
>
> out_file.close();
>
> }
>
> public void processEvent(final EventData d)
>
> {
>
> // Test write to file
>
> out_file.println("Write some output");
>
> }
>
>
> }
>
>
> the error message is :
> jas.job.AnalysisException:security.file.write:/amd/phys150/kmaha/lcd/
>
> Is there a mistake in the path name ?
> Could anyone please shed some light to this problem , that would
> be very helpful .
>
> thankyou ,
>
> Maha
--
---
Tony Johnson
Stanford Linear Accelerator Center
http://www-sld.slac.stanford.edu/tonywww/tony.html
|