The Artima Developer Community
Sponsored Link

Legacy Java Answers Forum
July 2001



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.


Yes it is poosible

Posted by Amit Dubey on August 02, 2001 at 12:05 PM

> Hi, I'm writing a program that works with files, and writing to files. I was wondering how I can append to a file that already exists. I've tried using the write method from the FileWriter class, but that just starts from the beginning of the file, and erases whatever is already there. Thanks in advance for the help.
> Hiran

Sure u can append to a file. All you have to do is, read till the end of file and then start writing to the file. Use the FileReader to read till the EOF and then user FileWriter to write to the file


Sponsored Links

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