|
Post by ~Memzak~ on Mar 5, 2011 23:17:00 GMT
For some reason I can't seem to append with it. try { BufferedWriter tl = new BufferedWriter(new FileWriter("monster",false)); //Replacing the Monster Count topline++; tl.write(Integer.toString(topline)); tl.close(); BufferedWriter tr = new BufferedWriter(new FileWriter("monster",true)); //Appending the New Monster Data tr.newLine(); tr.newLine(); tr.write(Mname); tr.newLine(); tr.write(Mchar); tr.newLine(); tr.write(Mcolor); tr.newLine(); tr.write(MHP); tr.newLine(); tr.write(Mdesc); tr.newLine(); tr.close(); System.out.println("\nWriting to file complete!\n"); All the variables (Mname, Mchar... etc) are already assigned values... Here's how the file was before running:
1 TEST T 111,111,111 15 TESTER MONSTER
Her it was after:
2 tg w 111,111,222 12 blahbablahblh
All it seems to do is replace the previous writing without appending. What it's meant to do is replace the first line (the number) and then append the rest of the data to the end. What's going on? (Looks at disabled or GV for an answer.... )
|
|