www.delorie.com/djgpp/doc/libc-2.01/libc_307.html   search  
Go to the first, previous, next, last section, table of contents.


ftruncate

Syntax

#include <unistd.h>

int ftruncate(int file, off_t where);

Description

This function truncates file at where length. This only works if the file is closed right after this call.

Return Value

Zero for success, nonzero for failure.

Example

int x = open("data", O_WRONLY);
ftruncate(x, 1000);
close(x);


Go to the first, previous, next, last section, table of contents.

  prev next   webmaster     delorie software   privacy  
  Copyright © 1997     Updated Apr 1997