source: trunk/minix/man/man2/truncate.2@ 22

Last change on this file since 22 was 9, checked in by Mattia Monga, 14 years ago

Minix 3.1.2a

File size: 707 bytes
Line 
1.TH TRUNCATE 2 "Feb 13, 2006"
2.UC 4
3.SH NAME
4truncate, ftruncate \- truncate a file to a specified length (may extend)
5.SH SYNOPSIS
6.ft B
7.nf
8#include <unistd.h>
9
10int truncate(char *filename, off_t length);
11int ftruncate(int fd, off_t length);
12.fi
13.ft R
14.SH DESCRIPTION
15.B Truncate
16causes the file
17.B filename
18to be set to the length
19.B length
20causing data after that size to be lost. If the file is set to a
21length larger than the current file size, the new region can be
22written to but reads as zeroes. There will be no disk blocks reserved
23for it. This is a hole.
24.PP
25.B Ftruncate
26does the same thing as
27.B truncate
28but operates on a file descriptor instead of a filename.
29.SH "SEE ALSO
30.BR fcntl (2)
Note: See TracBrowser for help on using the repository browser.