Another way which i have used if you want to delete random entries in a
flat file, is to store the entries in buffers as you move along the file
, without storing those entries you want deleted. you then rewrite to
the same file after you've gone through all the entries.
this is a roundabout way of doing it, but it works ok (unless of course
you have extremely large files). in which case, random-access class is
the way to go.
Timothy Gallagher wrote:
>
> If you don't have some form of delete indicator for each record, you
> will have copy the file to a temporary file while removing the data.
> Once the temporary file is created and filled, delete the original file
> and rename the temporary file.
>
> If you have a space for a delete indicator, I would suggest using a
> RandomAccessFile, seek() to the desired location, and set the indicator.
___________________________________________________________________________
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