com doc/zh: update tmpfile() Close php/doc-zh#27: reference/filesystem/functions/tmpfile.xml
| From: | Dai Jie | Date: | Fri, 12 Mar 2021 13:35:25 +0000 |
| Subject: | com doc/zh: update tmpfile() Close php/doc-zh#27: reference/filesystem/functions/tmpfile.xml | ||
| Groups: | php.doc.zh | ||
| Request: | Send a blank email to doc-zh+get-6003@lists.php.net to get a copy of this message | ||
Commit: 89cfef4b4ccc7f7ad7c9c4ae2ac5ad83f3406244
Author: 蒋文健 <jwjbjg@gmail.com> Thu, 11 Mar 2021 17:09:55 +0800
Committer: daijie <daijie@php.net> Fri, 12 Mar 2021 21:35:25 +0800
Parents: b6a233fcec859d8cfcf30eeee7e238636c2c4af9
Branches: master
Link: http://git.php.net/?p=doc/zh.git;a=commitdiff;h=89cfef4b4ccc7f7ad7c9c4ae2ac5ad83f3406244
Log:
update tmpfile()
Close php/doc-zh#27
Bugs:
https://bugs.php.net/27
Changed paths:
M reference/filesystem/functions/tmpfile.xml
Diff:
diff --git a/reference/filesystem/functions/tmpfile.xml b/reference/filesystem/functions/tmpfile.xml
index ce22d03a..e4587264 100644
--- a/reference/filesystem/functions/tmpfile.xml
+++ b/reference/filesystem/functions/tmpfile.xml
@@ -1,35 +1,37 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
-<!-- EN-Revision: 96c9d88bad9a7d7d44bfb7f26c226df7ee9ddf26 Maintainer: HonestQiao Status: ready
-->
+<!-- EN-Revision: b95d28e6ec86e4a71e012737d36ebdc1cf009180 Maintainer: HonestQiao Status: ready
-->
<!-- Reviewed: no Maintainer: HonestQiao -->
-<refentry xml:id="function.tmpfile" xmlns="http://docbook.org/ns/docbook">
+<refentry xmlns="http://docbook.org/ns/docbook"
xml:id="function.tmpfile">
<refnamediv>
<refname>tmpfile</refname>
<refpurpose>建立一个临时文件</refpurpose>
</refnamediv>
+
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
- <type>resource</type><methodname>tmpfile</methodname>
+ <type
class="union"><type>resource</type><type>false</type></type><methodname>tmpfile</methodname>
<void/>
</methodsynopsis>
<para>
-
以读写(w+)模式建立一个具有唯一文件名的临时文件,返回一个文件句柄。</para>
- <para>
- 文件会在关闭后(用
- <function>fclose</function>)自动被删除,或当脚本结束后。
+
以读写(w+)模式创建一个具有唯一文件名的临时文件,然后返回该文件的句柄。
</para>
<para>
- 详细信息请参考系统手册中的
- <literal>tmpfile(3)</literal> 函数,以及
- <filename>stdio.h</filename> 头文件。
+ 文件在关闭后(例如,调用 <function>fclose</function> 或
<function>tmpfile</function>
+ 返回的文件句柄已无引用的情况)或脚本运行结束后,会自动删除。
</para>
+ <caution>
+ <simpara>
+ 如果脚本运行被意外终止,可能不会删除该临时文件。
+ </simpara>
+ </caution>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
- 返回一个与 <function>fopen</function>
所打开返回类似的新文件句柄,&return.falseforfailure;.
+ 返回新文件的句柄,类似于 <function>fopen</function>
返回的文件句柄,&return.falseforfailure;。
</para>
</refsect1>