array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'zh', ), 'this' => array ( 0 => 'function.dio-truncate.php', 1 => 'dio_truncate', ), 'up' => array ( 0 => 'ref.dio.php', 1 => 'Direct IO 函数', ), 'prev' => array ( 0 => 'function.dio-tcsetattr.php', 1 => 'dio_tcsetattr', ), 'next' => array ( 0 => 'function.dio-write.php', 1 => 'dio_write', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'zh', 'path' => 'reference/dio/functions/dio-truncate.xml', ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); ?>
(PHP 4 >= 4.2.0, PHP 5 < 5.1.0)
dio_truncate — 截断文件描述符 fd 为 offset 字节
dio_truncate() 将文件截断为最多 offset
字节的大小。
如果先前的文件大于此大小,则额外的数据将丢失。如果先前的文件较小,不确定是保持文件不变还是扩展文件。在后一种情况下,扩展部分读取为零字节。
注意: 此函数未在 Windows 平台下实现。