This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes File writing Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "File writing" Watch "File writing" New topic
Author

File writing

Manoj Zachariah
Ranch Hand

Joined: Dec 08, 2003
Posts: 65
the code below rewrites the file each time, can i make it to append each time i run instead of overwriting.
Nischal Topno
Ranch Hand

Joined: Nov 24, 2001
Posts: 45
try the overloaded constructor of FileWriter(String fileName, boolean append). So in your case it will be
FileWriter fw = new FileWriter("Rule.xml", true);
Manoj Zachariah
Ranch Hand

Joined: Dec 08, 2003
Posts: 65
thanks
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: File writing