Article View: borland.public.jbuilder.java.language
Article #18253Re: FileWriter problem
From: Evan Koffler
Date: Wed, 22 Jul 1998 00:00
Date: Wed, 22 Jul 1998 00:00
18 lines
1035 bytes
1035 bytes
Fa.Zeppelin wrote:
> here is a simple code :
>
> File file=new File("test.txt");
> FileWriter out = new FileWriter(file);
> out.write("only a test");
> out.close();
>
> how can I later append text to the file "test.txt" without overwriting it ?
> Is there something like 'append' ??
Use the FileWriter constructor that has an append option.
FileWriter(File file, boolean append);
FileWriter out = new FileWriter(file, true);
Technical Details
Message-ID:
<35B6B397.E1BCBE4A@koffler.metronet.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<6p23fn$k6k4@forums.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f74b3,838a06d82cfb9ef2 X-Google-Attributes: gidf74b3,public From: Evan Koffler <evan@koffler.metronet.com> Subject: Re: FileWriter problem Date: 1998/07/22 Message-ID: <35B6B397.E1BCBE4A@koffler.metronet.com> X-Deja-AN: 374068003 Content-Transfer-Encoding: 7bit References: <6p23fn$k6k4@forums.borland.com> To: "Fa.Zeppelin" <Fa.Zeppelin@micronet.de> Content-Type: text/plain; charset=us-ascii Organization: Another Netscape Collabra Server User Mime-Version: 1.0 Newsgroups: borland.public.jbuilder.java.language