On Fri, 13-Dec-2002 at 05:41:41 -0800, David Schultz wrote:
> Thus spake Andre Albsmeier <[EMAIL PROTECTED]>:
> > Are there any special features in FreeBSD that I can use
> > to truncate a file in the beginning?
> > 
> > Let's assume I have a 50GB file. Only the last 10GB are
> > interesting for me and I have to free the first 40GB for
> > some reason. Of course, I could seek to the appropriate
> > position and copy the 10GB to a new file and unlink the
> > old one. The problem is that I don't have a lot of time
> > to do this so I am looking for something like ftruncate()
> > but for the beginning...
> 
> Nope, you have to copy the data.  Technically something like this
> could be implemented by copying metadata only, but it would only
> work if the amount you want to snip is a multiple of the
> filesystem's block size.  However, it's a lot of work for a rather
> uncommon case; even ftruncate() is used infrequently.  Perhaps you
> could devise a scheme for striping your data across multiple 10GB
> files.

Hmm, that's bad news :-). Thanks anyway, now I know that I have
to figure out something differently. Maybe I will create lots
of, let's say, 100MB files and manage them myself...

Thanks,

        -Andre

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-questions" in the body of the message

Reply via email to