M
Marcelo
Hi,
I am having a big trouble while saving information into a file. I would
like append some information into file. However, each time that I try to
do this, the information of the file is replaced by the new information.
What is wrong with my routine?
File simFile = new File("simulations.txt");
//System.out.println("simulations: "+simFile.getAbsolutePath());
try{
if(simFile == null)
throw new IOException();
BufferedWriter output = new BufferedWriter(new FileWriter(simFile));
String text = simObj.getInfo();
output.append(text);
//output.newLine();
closeFile(output);
}catch(IOException e){
System.err.println("Cannot save Simulation into file");
}
thanks very much,
Marcelo
I am having a big trouble while saving information into a file. I would
like append some information into file. However, each time that I try to
do this, the information of the file is replaced by the new information.
What is wrong with my routine?
File simFile = new File("simulations.txt");
//System.out.println("simulations: "+simFile.getAbsolutePath());
try{
if(simFile == null)
throw new IOException();
BufferedWriter output = new BufferedWriter(new FileWriter(simFile));
String text = simObj.getInfo();
output.append(text);
//output.newLine();
closeFile(output);
}catch(IOException e){
System.err.println("Cannot save Simulation into file");
}
thanks very much,
Marcelo