Path: utzoo!attcan!uunet!wuarchive!mit-eddie!uw-beaver!ubc-cs!alberta!mts.ucs.UAlberta.CA!Al_Dunbar From: userAKDU@mts.ucs.UAlberta.CA (Al Dunbar) Newsgroups: comp.lang.c Subject: Re: How do I SHORTEN a file without rewriting it? Message-ID: <1753@mts.ucs.UAlberta.CA> Date: 28 Oct 90 22:49:36 GMT References: <1162@bilver.UUCP> <2830@lectroid.sw.stratus.com> <5289@crash.cts.com> Organization: MTS Univ of Alberta Lines: 22 In article <5289@crash.cts.com>, lairdb@crash.cts.com (Laird Broadfield) writes: >In article <2830@lectroid.sw.stratus.com> bad@atrain.sw.stratus.com (Bruce Dumes) writes: >>In article <1162@bilver.UUCP> alex@bilver.UUCP (Alex Matulich) writes: >>> >>>Is there a way to shorten a file, that is, chop some data off the end of >> <<< deletions >>> >>Have you thought about using ftruncate()? > >Okay, tell us where in K&R you find ftruncate. I don't see it in > <<< deletions >>> >As long as we're on the subject, does anyone have a neat-o method for >getting rid of records from the _beginning_ of a file? (Standard preferred, >but if there's an MSDOS way, I'll accept it....) > Have you thought about using f_pre_truncate()? I think you'll find it with ftruncate(), but in smiley.lib, not in funky.lib. :-) -------------------+------------------------------------------- Al Dunbar | Edmonton, Alberta | this space for rent CANADA | -------------------+-------------------------------------------