ftruncate (was Set file size in SYSV)

Chris Torek chris at mimsy.UUCP
Tue Aug 15 20:32:41 AEST 1989


-In article <19072 at 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 <c0rl029p4a1201 at amdahl.uts.amdahl.com> kucharsk at 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 at mimsy.umd.edu	Path:	uunet!mimsy!chris



More information about the Comp.unix.questions mailing list