Links

Lists

Latest Updates

Ruby On Rails List
Python list
Advanced Java
The JavaScript List
Apache Users
Full Disclosure
Linux Security

Search the archives!


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Writing to the start of a file


  • From: rubz@xxxxxxxxxxxxxx (Reuben Firmin)
  • Subject: Writing to the start of a file
  • Date: Thu, 30 Sep 1999 14:56:20 -0400

Hi,

This may be ridiculously simple, but is there any clean way to write to the
*start* of a text file (like some guestbooks do)? I messed around with
RandomAccessFile for a bit, but it overwrote the stuff in the file. My
(imperfect but working and adequate for this particular low user situation)
is to read the file into a string buffer, write the new data using a
bufferedwriter, and then write the stuff from the string buffer after that.
But it is pretty inelegant and probably inefficient.

Anybody done this sort of thing before?

Cheers
Reuben Firmin
Internet/Java Developer, Liveonline.net
w. 212 741 3653 x19
h. 212 974 2352


---
To unsubscribe, mail advanced-java-unsubscribe@xxxxxxxxxxxxxxxx
To get help, mail advanced-java-help@xxxxxxxxxxxxxxxx