Manual Page Result
0
Command: truncate | Section: 2 | Source: MINIX | File: truncate.2
TRUNCATE(2) System Calls Manual TRUNCATE(2)
NAME
truncate, ftruncate - truncate a file to a specified length (may ex-
tend)
SYNOPSIS
#include <unistd.h>
int truncate(char *filename, off_t length);
int ftruncate(int fd, off_t length);
DESCRIPTION
Truncate causes the file filename to be set to the length length caus-
ing data after that size to be lost. If the file is set to a length
larger than the current file size, the new region can be written to but
reads as zeroes. There will be no disk blocks reserved for it. This is
a hole.
Ftruncate does the same thing as truncate but operates on a file de-
scriptor instead of a filename.
SEE ALSO
fcntl(2)
4th Berkeley Distribution Feb 13, 2006 TRUNCATE(2)