Newsgroups: comp.lang.c
Path: utzoo!henry
From: henry@zoo.toronto.edu (Henry Spencer)
Subject: Re: How do you truncate a file?
Message-ID: <1991May5.052008.23524@zoo.toronto.edu>
Date: Sun, 5 May 1991 05:20:08 GMT
References: <1991May5.024348.4203@csusac.csus.edu>
Organization: U of Toronto Zoology

In article <1991May5.024348.4203@csusac.csus.edu> cilibrar@athena.ecs.csus.edu (Rudi Cilibrasi) writes:
>Suppose I have a 100-byte file called "myfile.dat", and I want to get
>rid of the last 10 bytes...

ANSI C provides no way to truncate a file without reading and rewriting it.
In fact, there is no portable way; some systems can't do it.

If you wanted a system-specific way to do it, you should ask the question
in a suitable newsgroup, like comp.os.msdos.programmer or comp.unix.questions.
-- 
And the bean-counter replied,           | Henry Spencer @ U of Toronto Zoology
"beans are more important".             |  henry@zoo.toronto.edu  utzoo!henry
