Re: File questions: Head truncate? sharing FDs between procs?

From: willy@thepuffingroup.com
Date: Tue May 23 2000 - 15:47:28 EST


On Tue, May 23, 2000 at 11:50:55AM -0600, Ian S. Nelson wrote:
> I think I know the answer to this first question already. Is there a
> head trunc function? I don't think there is but you never know. The
> situation is like this: we've got a large file (multiple gigs) and at
> some point while still writing data to it we realize that we don't want
> the first 500MB so we want to trunc it off the front of the file will
> keeping it open and keep writing to it. Anyone want head trunc if I get
> strapped in to writing it?

Hm. You really don't want to truncate the first 500MB and juggle
pointers; a better solution would be to make a hole in the file for the
first 500MB. I think your best bet for implementing this is to create a
->zero inode operation which a fs which supports holes can implement by
unmapping previously allocated blocks and dain-bread fs' can write zeroes.
What the userspace API to this function would be, I'm not sure.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Tue May 23 2000 - 21:00:24 EST