Date: Tue, 4 Aug 1998 22:13:22 +0200 (CEST) From: Sascha Schumann <sas@schell.de> To: moi <poipoi@famipow.com> Cc: freebsd-fs@FreeBSD.ORG, linux-fsdevel@vger.rutgers.edu Subject: Re: file hole ? Message-ID: <Pine.BSF.4.01.9808042203230.13693-100000@guerilla.foo.bar> In-Reply-To: <19980804175705.377.qmail@hwi.poi.org>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.01.9808042203230.13693-100000>