Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!cs.utexas.edu!natinst!sequoia!rpp386!jfh From: jfh@rpp386.Dallas.TX.US (John F. Haugh II) Newsgroups: comp.unix.wizards Subject: Re: Releasing blocks from a file Summary: What's wrong with fclear()? Message-ID: <16557@rpp386.Dallas.TX.US> Date: 20 May 89 00:15:33 GMT References: <461@anvil.oz> Reply-To: jfh@rpp386.Cactus.ORG (John F. Haugh II) Organization: River Parishes Programming, Dallas TX Lines: 27 In article <461@anvil.oz> michi@anvil.oz (Michael Henning) writes: >4.3 BSD has a truncate() system call to get rid of trailing blocks at the end >of a file. I believe that this was introduced to allow certain FORTRAN >libraries to work under UNIX, which depended on that feature. >I would like to know why this has not been generalised to allow >*any* block of a file to be released. For example, in random access files >such as B-trees, on deletion, one would like to get rid of a disk block. I believe fclear() allows you to de-allocate blocks from random locations within a file. I think the syntax is like fclear (fd, whence, nbytes); where fd is the open file descriptor, whence is the file offset and nbytes is the number of bytes worth of hole to create. This may be wrong. The manuals are at work. This will not truncate the length of a file, as I recall. However ftruncate() is available for that situation. Oh - I'm not an AIX developer. I just play one on the net :-) You will want to read your manuals for more accurate information. -- John F. Haugh II +-Button of the Week Club:------------- VoiceNet: (512) 832-8832 Data: -8835 | "AIX is a three letter word, InterNet: jfh@rpp386.Cactus.Org | and it's BLUE." UucpNet : !bigtex!rpp386!jfh +--------------------------------------