Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!tut.cis.ohio-state.edu!att!laidbak!elaited!daveb From: daveb@elaited.i88.isc.com (Dave Burton) Newsgroups: comp.unix.questions Subject: Re: F_FREESP argument to fcntl() (was: Re: sparse files) Message-ID: <1989Dec13.170703.24948@i88.isc.com> Date: 13 Dec 89 17:07:03 GMT References: <21581@adm.BRL.MIL> <235@dg.dg.com> <2700@auspex.auspex.com> <1650@ctisbv.cti-software.nl> Sender: usenet@i88.isc.com (Usenet News) Reply-To: daveb@i88.isc.com (Dave Burton) Organization: Interactive Systems nee Lachman Associates Lines: 21 In article <1650@ctisbv.cti-software.nl> pim@cti-software.nl (Pim Zandbergen) writes: |I think the *undocumented* F_FREESP argument to fcntl() |in lots of versions of SYSVR3 can do this too. |Take a look in /usr/include/sys/fcntl.h to find out if yours has it. This first appeared in SVR3.1, I believe. It is undocumented because, according to the comments: ``This is an experimental facility for SVR3.1 and WILL be changed in the next release.'' [emphasis in the original]. It is interesting that this appears in the SVR3.2 source. |But I see no reason why [F_FREESP] could not be used to punch |a hole in the middle of a file. | |Can anybody confirm this? This could be the base of a handy |tool able to free LOTS of disk space. Unfortunately, SVR3.[12].0 F_FREESP cannot do this, because any value of l_len != 0 fails with EINVAL (and 0 means ``to end of file''). -- Dave Burton uunet!ism780c!laidbak!daveb