Path: utzoo!attcan!utgpu!watmath!iuvax!uxc.cso.uiuc.edu!tank!mimsy!chris
From: chris@mimsy.UUCP (Chris Torek)
Newsgroups: comp.unix.questions
Subject: ftruncate (was Set file size in SYSV)
Keywords: How
Message-ID: <19088@mimsy.UUCP>
Date: 15 Aug 89 10:32:41 GMT
References: <708@msa3b.UUCP> <18lG02Em4aQn01@amdahl.uts.amdahl.com> 
Organization: U of Maryland, Dept. of Computer Science, Coll. Pk., MD 20742
Lines: 21

-In article <19072@mimsy.UUCP> I remarked that
->The 4BSD ftruncate() call will not extend files.  (If it did,
->it would probably have been called `fsetsize'; ....

In article  kucharsk@uts.amdahl.com
(William Kucharski) writes:
-Well, it may not be a good porting guide, but my SunOS 4.0 man page says:
-
-DESCRIPTION
-     truncate() causes the file  referred  to  by  path  (or  for
-     ftruncate()  the  object  referred  to by fd) to have a size
-     equal to length bytes. ... [If this extends the file,] bytes
-     between the old and new lengths are read as zeroes. [...]

This is either a bug in the SunOS manpage (there are, it seems, many
such) or---in this particular case, more likely---Yet Another Difference
between SunOS and 4BSD.  Here the function is useful, but the name is
bad.
-- 
In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7163)
Domain:	chris@mimsy.umd.edu	Path:	uunet!mimsy!chris