Article View: borland.public.jbuilder.java.api
Article #3251Re: appending a file
From: James D. Frentress
Date: Tue, 31 Mar 1998 00:00
Date: Tue, 31 Mar 1998 00:00
27 lines
1341 bytes
1341 bytes
Sean C. Sheridan wrote:
> Looking for advice / help on appending a file:
>
> 1. How do I 'open' an exsisting file (vs. creating a new one)
> 2. How do I use the 'append' flag on FileOutputStream
> 3. Does anyone have a (simple) example of a file locking
> system?
> 4. Must I use a file locking system? (The data is coming in
> through
> an applet ... multiple users ... yadda yadda yadda).
>
> Thanks,
>
> seanc@seas.upenn.edu
>
> File outputFile = new File("out.txt");
> FileOutputStream fos = new FileOutputStream(outputFile);
> String key = (String) e.nextElement();
> String dataOut = (key + " = " + req.getParameter(key) + "; ");
> out.println(dataOut);
> fos.write(dataOut.getBytes());
>
> fos.close();
FileOutputStream fos = new FileOutputStream(outputFile, true);
Technical Details
Message-ID:
<35218E35.628BE195@seanet.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<352174A8.8B52EC7D@seas.upenn.edu>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1089d0,8a6b5c9ff650d8d7 X-Google-Attributes: gid1089d0,public From: "James D. Frentress" <srschill@seanet.com> Subject: Re: appending a file Date: 1998/03/31 Message-ID: <35218E35.628BE195@seanet.com> X-Deja-AN: 339654382 Content-Transfer-Encoding: 7bit References: <352174A8.8B52EC7D@seas.upenn.edu> X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Organization: Microsoft Mime-Version: 1.0 Newsgroups: borland.public.jbuilder.java.api