Chang You-Sheng wrote:

> >From I know, FileWriter is a stream type class. And all stream type classes is
> only suitable to deal with stream. In other words, like network communication.
> If you use it to append info. to a existing file, you have to read all contents
> out into a StringBuffer, Appending then write back.
>

Try this:

    FileWriter writer = newFileWriter(pathname, true);

The second argument to the construct is the "append" flag that positions you at
the end of the file.  Then you can append to your heart's content.

>
>      you shneg
>      certified Java programmer
>

NOTE:  the "append" flag is documented in the JDK API docs.  That's always a good
place to start on questions like this.

Craig McClanahan

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to