Home > PHP > Function > Direct IO > dio_truncate()

dio_truncate()

dio_truncate - Truncates file descriptor fd to offset bytes

Syntax

bool dio_truncate (resource $fd, int $offset)

Arguments

  • fd - The file descriptor returned by dio_open().
  • offset - The offset in bytes.

Description

dio_truncate() truncates a file to at most offset bytes in size.

Version

PHP 4.2.0, 5 <= 5.0.5

Return value

Returns TRUE on success or FALSE on failure.