truncate man page on DigitalUNIX

Man page or keyword search:  
man Server   12896 pages
apropos Keyword Search (all sections)
Output format
DigitalUNIX logo
[printable version]

truncate(3)							   truncate(3)

NAME
       truncate - sets a file to a specified length

SYNOPSIS
       #include <sys/types.h>

       int truncate (const char *path, off_t length );

LIBRARY
       SVR4 Library (libsvr4)

DESCRIPTION
       The  file  whose	 name is given by path or referenced by the descriptor
       files has its size set to length bytes.

       If the file was previously longer than length, bytes past  length  will
       no  longer  be accessible. If it was shorter, bytes from the EOF before
       the call to the EOF after the call will be read in as zeros. The effec‐
       tive user ID of the process must have write permission for the file.

RETURN VALUES
       Success.	 Failure.

ERRORS
       Errno  is  set  to indicate the errors. Failure may result from: Search
       permission is denied on a component of the path prefix.	Write  permis‐
       sion  is	 denied for the file referred to by path.  Path points outside
       the process's allocated address space.  A signal was caught during exe‐
       cution  of the truncate routine.	 Path is not an ordinary file.	An I/O
       error occured while reading from or writing to the  file	 system.   The
       file  referred to by path is a directory.  Too many symbolic links were
       encountered in translating the path.  The length of  a  path  component
       exceeds {NAME_MAX} characters, or the length of path exceeds {PATH_MAX}
       characters.  Either a component of the path prefix or the file referred
       to  by  path does not exist.  A component of the path prefix of path is
       not a directory.	 The file referred to by path resides on  a  read-only
       file.

RELATED INFORMATION
       Functions: chmod(2), fcntl(2), open(2)

								   truncate(3)
[top]

List of man pages available for DigitalUNIX

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net