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]

Shortening file length on RandomAccessFile


  • From: jsturm@xxxxxxxxxx (Jeff Sturm)
  • Subject: Shortening file length on RandomAccessFile
  • Date: Tue, 31 Aug 1999 16:22:40 -0400

There is no portable way to shorten a file.  On many platforms you must
resort to recreating the file, even if you code in C.

Andy Wiese wrote:
> 
> Is there a way that I can reduce the length of a RandomAccessFile? I am
> using RandomAccessFile to implement a small database...when the total
> stored data shrinks, I would like to reduce the length of the file. I am
> trying to avoid writing out a new file because of cross-platform issues
> (it needs to run well on the Mac, and if I recreate the file I lose the
> resource fork).
> 
> --
> ================
> v. Anderson Wiese 2
> president
> Bluestem Inc.
> www.bluestem.net
> ================

-- 
Jeff Sturm
jsturm@xxxxxxxxxx