How do I SHORTEN a file without rewriting it?

Bruce Dumes bad at atrain.sw.stratus.com
Thu Oct 25 00:00:02 AEST 1990


In article <1162 at bilver.UUCP> alex at bilver.UUCP (Alex Matulich) writes:
>
>Is there a way to shorten a file, that is, chop some data off the end of
>it, so that it doesn't consume as much physical space on the disk?  The
>file I have is too big to read into memory and write back out again, and
>there is not enough room on the disk to write out a temporary file.
>

Have you thought about using ftruncate()?

Bruce


--
Bruce Dumes			|  "You don't see many of *these* nowdays, |
bad at zen.cac.stratus.com		|   do you?"				   |



More information about the Comp.lang.c mailing list