Win a copy of The Way of the Web Tester: A Beginner's Guide to Automating Tests this week in the Testing forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Buffered Writer problem

sujay bawaskar
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to write a file on unix in append mode with following code:

long ts=System.currentTimeMillis();
String filename="temp"+ts+".txt";
File file=new File(filename);
FileWriter fw=new FileWriter(file,true);
BufferedWriter bw=new BufferedWriter(fw);
bw.write(excelString.toString()); //excelString is StringBuffer

//pseudo code
for loop{
//some code here for populating excelString

This seems to work fine on MS windows xp but it is overwriting file when it runs on unix.
I am not getting where exactly is the problem. Is the APIs have different behavioral constucts with unix?
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic