diff options
| author | Alexander Langer <alex@FreeBSD.org> | 1996-06-07 01:34:47 +0000 | 
|---|---|---|
| committer | Alexander Langer <alex@FreeBSD.org> | 1996-06-07 01:34:47 +0000 | 
| commit | 79020cf23f23ffcbf059d9cf408f58befa84c08d (patch) | |
| tree | bb8389a7d17ceda4bdd71d181893b503187a0150 /lib | |
| parent | 4eaf2ef2cdf66a9e4722f9db81874d6cc2c490e4 (diff) | |
Notes
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/libc/sys/truncate.2 | 10 | 
1 files changed, 8 insertions, 2 deletions
| diff --git a/lib/libc/sys/truncate.2 b/lib/libc/sys/truncate.2 index 2a5f3a67a136..b9c039a766bc 100644 --- a/lib/libc/sys/truncate.2 +++ b/lib/libc/sys/truncate.2 @@ -37,7 +37,7 @@  .Sh NAME  .Nm truncate ,  .Nm ftruncate -.Nd truncate a file to a specified length +.Nd truncate or extend a file to a specified length  .Sh SYNOPSIS  .Fd #include <unistd.h>  .Ft int @@ -50,11 +50,13 @@ causes the file named by  .Fa path  or referenced by  .Fa fd -to be truncated to at most +to be truncated or extended to  .Fa length  bytes in size.  If the file previously  was larger than this size, the extra data  is lost. +If the file was smaller than this size, +extra zeros are appended.  With  .Fn ftruncate ,  the file must be open for writing. @@ -116,6 +118,10 @@ is not open for writing.  .Sh BUGS  These calls should be generalized to allow ranges  of bytes in a file to be discarded. +.Pp +Use of +.Fn truncate +to extend a file is not portable.  .Sh HISTORY  The  .Nm | 
