From f8e186e8b1df8d37914d2651dfe51c65e3641282 Mon Sep 17 00:00:00 2001 From: Ben Gras Date: Mon, 13 Feb 2006 12:53:50 +0000 Subject: [PATCH] Added truncate/ftruncate manpage. --- man/man2/truncate.2 | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 man/man2/truncate.2 diff --git a/man/man2/truncate.2 b/man/man2/truncate.2 new file mode 100644 index 000000000..4102e6d82 --- /dev/null +++ b/man/man2/truncate.2 @@ -0,0 +1,30 @@ +.TH TRUNCATE 2 "Feb 13, 2006" +.UC 4 +.SH NAME +truncate, ftruncate \- truncate a file to a specified length (may extend) +.SH SYNOPSIS +.ft B +.nf +#include + +int truncate(char *filename, off_t length); +int ftruncate(int fd, off_t length); +.fi +.ft R +.SH DESCRIPTION +.B Truncate +causes the file +.B filename +to be set to the length +.B length +causing 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. +.PP +.B Ftruncate +does the same thing as +.B truncate +but operates on a file descriptor instead of a filename. +.SH "SEE ALSO +.BR fcntl (2)