@node ftruncate, stdio @findex ftruncate @subheading Syntax @example #include int ftruncate(int handle, off_t where); @end example @subheading Description This function truncates the file open on @var{handle} at byte position @var{where}. The file pointer associated with @var{handle} is not changed. Note that this function knows nothing about buffering by stdio functions like @code{fwrite} and @code{fprintf}, so if @var{handle} comes from a @code{FILE} object, you need to call @code{fflush} before calling this function. @code{ftruncate} does not support directories. @subheading Return Value Zero for success, nonzero for failure. @subheading Portability @portability !ansi, !posix @subheading Example @example int x = open("data", O_WRONLY); ftruncate(x, 1000); close(x); @end example