From owner-freebsd-hackers Sat May 29 9:22:41 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from mail4.aracnet.com (mail4.aracnet.com [205.159.88.46]) by hub.freebsd.org (Postfix) with ESMTP id 6ED6214E7B for ; Sat, 29 May 1999 09:22:39 -0700 (PDT) (envelope-from beattie@aracnet.com) Received: from shell2.aracnet.com (IDENT:1728@shell2.aracnet.com [205.159.88.20] (may be forged)) by mail4.aracnet.com (8.9.1/8.9.1) with ESMTP id JAA08177; Sat, 29 May 1999 09:22:42 -0700 Received: from localhost by shell2.aracnet.com (8.8.7) id JAA02248; Sat, 29 May 1999 09:22:42 -0700 X-Authentication-Warning: shell2.aracnet.com: beattie owned process doing -bs Date: Sat, 29 May 1999 09:22:42 -0700 (PDT) From: Brian Beattie To: Zhihui Zhang Cc: "Christopher R. Bowman" , freebsd-hackers@FreeBSD.ORG Subject: Re: Algorithm used to delete part of a file In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Fri, 28 May 1999, Zhihui Zhang wrote: > > Thanks for your valuable information. This explains why I have not found > any routines in the files under /ufs/ffs and /ufs/ufs that re-organize the > on-disk image of a file in that way. If a middle part of a file is > deleted, then all the remaining part of the file must be read by an editor > (such as vi) and written out to another place before the file length is > truncated. This algorithm seems to be not very efficient. But disk is not > like memory, where we can simply modify pointers to point to new locations > easily, I guess there may be no better way to do this. If you have any > ideas about why this is not done by the filesystem itself, please let me > know. > Because deleting the middle of a file is an relatively uncommon operation. Text editing is in the overall operation of a system not the most common application. > Thanks for your help. > > Zhihui > > > > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-hackers" in the body of the message > Brian Beattie | The only problem with beattie@aracnet.com | winning the rat race ... www.aracnet.com/~beattie | in the end you're still a rat To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message