Path: utzoo!attcan!uunet!zephyr.ens.tek.com!uw-beaver!mit-eddie!bu.edu!rpi!crdgw1!ge-dab!tarpit!bilver!alex From: alex@bilver.UUCP (Alex Matulich) Newsgroups: comp.lang.c Subject: Re: How do I SHORTEN a file without rewriting it? Keywords: truncation Message-ID: <1244@bilver.UUCP> Date: 26 Oct 90 01:15:51 GMT References: <1162@bilver.UUCP> <179@ptcburp.ptcbu.oz.au> Reply-To: alex@bilver.UUCP (Alex Matulich) Organization: W. J. Vermillion - Winter Park, FL Lines: 22 In article <179@ptcburp.ptcbu.oz.au> michi@ptcburp.ptcbu.oz.au (Michael Henning) writes: >>Is there a way to shorten a file, that is, chop some data off the end of > >Ftruncate() (BSD call) will do the job. Under AIX (maybe others), there >is an fclear() call that allows you to punch holes into a file at arbitrary >places. The blocks corresponding the hole(s) are returned to the file system. >In SysV.4, you can use fntl() to do the same. All very fine suggestions, provided I am running unix or a derivative of unix. A couple ANSI C-compilers I have looked at for MS-DOS do not have these functions. I was hoping there was a portable ANSI-ish way to accomplish this, but it's beginning to look like that's not the case. Thanks to all those who replied to my question! -- _ |__ Alex Matulich (alex@bilver.UUCP) /(+__> Unicorn Research Corp, 4621 N Landmark Dr, Orlando, FL 32817 //| \ UUCP: ...uunet!tarpit!bilver!alex ///__) bitnet: IN%"bilver!alex@uunet.uu.net"