*BSD News Article 11372


Return to BSD News archive

Received: by minnie.vk1xwt.ampr.org with NNTP
	id AA1698 ; Tue, 23 Feb 93 14:54:11 EST
Newsgroups: comp.unix.bsd
Path: sserve!manuel.anu.edu.au!munnari.oz.au!news.Hawaii.Edu!ames!agate!howland.reston.ans.net!zaphod.mps.ohio-state.edu!menudo.uh.edu!uuneo!sugar!peter
From: peter@NeoSoft.com (Peter da Silva)
Subject: Re: [386BSD] truncating the beginning of a file
Organization: NeoSoft Communications Services -- (713) 684-5900
Date: Fri, 19 Feb 1993 11:26:12 GMT
Message-ID: <C2p13p.6Iw@sugar.neosoft.com>
References: <1lm5qhINN8vb@life.ai.mit.edu> <C2HKn4.Bry@sugar.neosoft.com> <1m0lejINNhpr@life.ai.mit.edu>
Lines: 21

In article <1m0lejINNhpr@life.ai.mit.edu> mycroft@hal.gnu.ai.mit.edu (Charles Hannum) writes:
> This is not what I had in mind.  I simply want to be able to chop off
> the beginning of a file, like ftruncate() chops off the end.

OK. One complication with this is, you can chop off any number of bytes at
the end, but you'd have to chop off an even block count at the beginning.

> I can
> think of several important applications which would benefit greatly
> from this.

Log files?

You might want to think about implementing the log file type described in
the Viva file system paper. It builds a circular buffer and automagically
presents only the last <x> blocks. The file becomes a seekable fifo.
-- 
Peter da Silva.  <peter@sugar.neosoft.com>.
 `-_-'   Oletko halannut suttasi tänään?
  'U`    
Tarjoilija, tämä ateria elää vielä.