delorie.com/djgpp/doc/libc/libc_368.html | search |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
#include <unistd.h> int ftruncate(int handle, off_t where); |
This function truncates the file open on handle at byte position where. The file pointer associated with handle is not changed.
Note that this function knows nothing about buffering by stdio functions
like fwrite
and fprintf
, so if handle comes from a
FILE
object, you need to call fflush
before calling this
function.
ftruncate
does not support directories.
Zero for success, nonzero for failure.
ANSI/ISO C | No |
POSIX | No |
int x = open("data", O_WRONLY); ftruncate(x, 1000); close(x); |
webmaster | delorie software privacy |
Copyright © 2004 | Updated Apr 2004 |