Opening file in append mode

How can I open an existing file in append mode and add some texts to it. A code snippet will be highly appreciated.
dipak_kr_ghoshAsked:
Who is Participating?
 
heyhey_Connect With a Mentor Commented:
PrintWriter writer = new PrintWriter(new FileOutputStream(name, true));
writer.print("new line");
writer.close();

you can use FileOutputStream("data", true) too
0
 
rameshaaCommented:
Read the foll.

FileWriter
public FileWriter(String fileName,
                  boolean append)
           throws IOException

if append flag is true, and the file is
exist it will open the file in append mode.
 so after that
 fileWriterObj.write() will write
info. to file.
0
 
dipak_kr_ghoshAuthor Commented:
Thanks to rameshaa also.
 
0
 
MoondancerCommented:
This question was awarded, but never cleared due to the JSP-500 errors of that time.  It was "stuck" against userID -1 versus the intended expert whom you awarded.  This corrects the problem and the expert will now receive these points; points verified.

Please click on your Member Profile and select "View Question History" to navigate through any open or locked questions you may have to update and finalize them.  If you are an EE Pro user, you can also choose Power Search to find all your open questions.

This is the Community Support link, if help is needed.  Also a question is posted there specific to these changes that apply to the experts here.  Also, I am including the link to our All Topics, since many new ones have recently been added.

http://www.experts-exchange.com/jsp/qList.jsp?ta=commspt
http://www.experts-exchange.com/jsp/zonesAll.jsp
 
Thank you,
Moondancer
Moderator @ Experts Exchange
0
All Courses

From novice to tech pro — start learning today.