php-doc-en/reference/filesystem/functions/ftruncate.xml
Jakub Vrana 3aaf76b76d File pointer movement (bug )
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@185459 c90b9560-bf6c-de11-be94-00142212c4b1
2005-04-29 14:19:03 +00:00

60 lines
1.8 KiB
XML

<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.7 $ -->
<!-- splitted from ./en/functions/filesystem.xml, last change in rev 1.14 -->
<refentry id="function.ftruncate">
<refnamediv>
<refname>ftruncate</refname>
<refpurpose>Truncates a file to a given length</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>bool</type><methodname>ftruncate</methodname>
<methodparam><type>resource</type><parameter>handle</parameter></methodparam>
<methodparam><type>int</type><parameter>size</parameter></methodparam>
</methodsynopsis>
<para>
Takes the filepointer, <parameter>handle</parameter>, and truncates the file to
length, <parameter>size</parameter>. &return.success;
</para>
<note>
<para>
The file pointer is changed only in <emphasis>append</emphasis> mode. In
<emphasis>write</emphasis> mode, additional <function>fseek</function>
call is needed.
</para>
</note>
<note>
<para>
Prior to PHP 4.3.3, <function>ftruncate</function> returns an
<type>integer</type> value of 1 on success, instead of
<type>boolean</type> &true;.
</para>
</note>
<para>
See also <function>fopen</function> and
<function>fseek</function>.
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->