F_FREESP argument to fcntl() (was: Re: sparse files)

Dave Burton daveb at elaited.i88.isc.com
Thu Dec 14 04:07:03 AEST 1989


In article <1650 at ctisbv.cti-software.nl> pim at 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



More information about the Comp.unix.questions mailing list