From owner-freebsd-fs Tue Aug 4 13:13:56 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id NAA18277 for freebsd-fs-outgoing; Tue, 4 Aug 1998 13:13:56 -0700 (PDT) (envelope-from owner-freebsd-fs@FreeBSD.ORG) Received: from www.schell.de ([195.20.238.2]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id NAA18254 for ; Tue, 4 Aug 1998 13:13:49 -0700 (PDT) (envelope-from sas@schell.de) Received: from guerilla.foo.bar (hennen15.iserlohn.netsurf.de [194.195.194.207]) by www.schell.de (8.9.0/8.9.0) with ESMTP id WAA25522; Tue, 4 Aug 1998 22:13:29 +0200 Received: from localhost (localhost.foo.bar [127.0.0.1]) by guerilla.foo.bar (8.9.1/8.9.1) with SMTP id WAA13809; Tue, 4 Aug 1998 22:13:22 +0200 (CEST) Date: Tue, 4 Aug 1998 22:13:22 +0200 (CEST) From: Sascha Schumann To: moi cc: freebsd-fs@FreeBSD.ORG, linux-fsdevel@vger.rutgers.edu Subject: Re: file hole ? In-Reply-To: <19980804175705.377.qmail@hwi.poi.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-fs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org man 2 lseek: "The lseek() function allows the file offset to be set beyond the end of the existing end-of-file of the file. If data is later written at this point, subsequent reads of the data in the gap return bytes of zeros (until data is actually written into the gap). ..." Most fs' I know (including UFS and ext2fs) preallocate blocks before data is written, so you will never have this kind of file fragmentation. HTH, Sascha On Tue, 4 Aug 1998 poipoi@famipow.com wrote: > hi > > i want to know how to handle file hole. > for example, i have a 8k file. i do a seek at 20000 and write a byte. > > Does the fs alloc every block to store 20001 bytes ? > yes ? but its a space wasting... > no ? but when the user will fill the hole (writing from 8192 to 20000), > my fs will perhaps be full and i have to reject the write operation... > > what is the standard (good?) behaviour ? and why (if possible) ? > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-fs" in the body of the message > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-fs" in the body of the message