The Artima Developer Community
Sponsored Link

Legacy Java Answers Forum
September 2000



This page contains an archived post to the Java Answers Forum made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.


Re: Appending to a file

Posted by Salil V Gangal on September 08, 2000 at 6:32 PM

Hi Vijay,

I assume that you already know how to open and write to a text file. So the only thing different in appending is to open the file in 'append' mode.

Use the following statement instead of your normal statement for opening the file.

diskOut = new FileOutputStream("outputfilename", true);

Please note, the only different is the , true which one has to add while opening.

Salil V Gangal


Sponsored Links

Copyright © 1996-2009 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us