ftruncate
将文件截断到指定的长度
&reftitle.description;
boolftruncate
resourcestream
intsize
接受文件指针 stream 作为参数,并将文件大小截取为
size。
&reftitle.parameters;
stream
文件指针。
stream 必须打开写入。
size
截断的大小。
If size is larger than the file then the file
is extended with null bytes.
If size is smaller than the file then the file
is truncated to that size.
&reftitle.returnvalues;
&return.success;
&reftitle.examples;
文件截取示例
]]>
&reftitle.notes;
文件指针不会改变。
&reftitle.seealso;
fopen
fseek