[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

truncate

Syntax

 
#include <unistd.h>

int truncate(const char *file, off_t size);

Description

This function truncates file to size bytes.

Return Value

Zero on success, nonzero on failure.

Portability

ANSI/ISO C No
POSIX No

Example

 
truncate("/tmp/data.txt", 400);