mirror of
https://github.com/fofolee/uTools-Manuals.git
synced 2025-06-18 05:26:57 +08:00
181 lines
7.0 KiB
HTML
181 lines
7.0 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||
<html>
|
||
<head>
|
||
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
||
<title>Get file system statistics</title>
|
||
</head>
|
||
<body class="docs"><div id="layout">
|
||
<div id="layout-content"><div id="function.eio-statvfs" class="refentry">
|
||
<div class="refnamediv">
|
||
<h1 class="refname">eio_statvfs</h1>
|
||
<p class="verinfo">(PECL eio >= 0.0.1dev)</p><p class="refpurpose"><span class="refname">eio_statvfs</span> — <span class="dc-title">Get file system statistics</span></p>
|
||
|
||
</div>
|
||
|
||
<div class="refsect1 description" id="refsect1-function.eio-statvfs-description">
|
||
<h3 class="title">说明</h3>
|
||
<div class="methodsynopsis dc-description">
|
||
<span class="methodname"><strong>eio_statvfs</strong></span>
|
||
( <span class="methodparam"><span class="type">string</span> <code class="parameter">$path</code></span>
|
||
, <span class="methodparam"><span class="type">int</span> <code class="parameter">$pri</code></span>
|
||
, <span class="methodparam"><span class="type"><a href="language.types.callable.html" class="type callable">callable</a></span> <code class="parameter">$callback</code></span>
|
||
[, <span class="methodparam"><span class="type"><a href="language.pseudo-types.html#language.types.mixed" class="type mixed">mixed</a></span> <code class="parameter">$data</code></span>
|
||
] ) : <span class="type">resource</span></div>
|
||
|
||
<p class="para rdfs-comment">
|
||
<span class="function"><strong>eio_statvfs()</strong></span> returns file system statistics information in
|
||
<code class="parameter">result</code> argument of <code class="parameter">callback</code>
|
||
</p>
|
||
</div>
|
||
|
||
|
||
<div class="refsect1 parameters" id="refsect1-function.eio-statvfs-parameters">
|
||
<h3 class="title">参数</h3>
|
||
<dl>
|
||
|
||
|
||
<dt>
|
||
<code class="parameter">path</code></dt>
|
||
|
||
<dd>
|
||
|
||
<p class="para">
|
||
Pathname of any file within the mounted file system
|
||
</p>
|
||
</dd>
|
||
|
||
|
||
|
||
<dt>
|
||
<code class="parameter">pri</code></dt>
|
||
|
||
<dd>
|
||
|
||
<p class="para">请求的优先级:<strong><code>EIO_PRI_DEFAULT</code></strong>,<strong><code>EIO_PRI_MIN</code></strong>,<strong><code>EIO_PRI_MAX</code></strong> 或 <strong><code>NULL</code></strong>。如果是
|
||
<strong><code>NULL</code></strong>,<code class="parameter">pri</code> 将设为
|
||
<strong><code>EIO_PRI_DEFAULT</code></strong>。
|
||
</p>
|
||
|
||
</dd>
|
||
|
||
|
||
|
||
<dt>
|
||
<code class="parameter">callback</code></dt>
|
||
|
||
<dd>
|
||
|
||
<p class="para">
|
||
<code class="parameter">callback</code>
|
||
函数在请求完成时被调用。其应匹配一下原型:<div class="example-contents"><div class="phpcode"><pre><span style="color: #000000">
|
||
void callback(mixed $data, int $result[, resource $req]);</span>
|
||
</pre></div></div>
|
||
|
||
<dl>
|
||
|
||
|
||
<dt>
|
||
<code class="parameter">data</code></dt>
|
||
|
||
<dd>
|
||
<p class="para">传递给请求的用户数据。</p></dd>
|
||
|
||
|
||
|
||
<dt>
|
||
<code class="parameter">result</code></dt>
|
||
|
||
<dd>
|
||
<p class="para">针对请求的结果的值。通常是相应的系统调用返回的值。</p></dd>
|
||
|
||
|
||
|
||
<dt>
|
||
<code class="parameter">req</code></dt>
|
||
|
||
<dd>
|
||
<p class="para">可选的请求资源,可被 <span class="function"><a href="eio_get_last_error.html" class="function">eio_get_last_error()</a></span>
|
||
之类的函数使用。</p></dd>
|
||
|
||
|
||
</dl>
|
||
|
||
</p>
|
||
|
||
</dd>
|
||
|
||
|
||
|
||
<dt>
|
||
<code class="parameter">data</code></dt>
|
||
|
||
<dd>
|
||
|
||
<p class="para">
|
||
Arbitrary variable passed to <code class="parameter">callback</code>.
|
||
</p>
|
||
</dd>
|
||
|
||
|
||
</dl>
|
||
|
||
</div>
|
||
|
||
|
||
<div class="refsect1 returnvalues" id="refsect1-function.eio-statvfs-returnvalues">
|
||
<h3 class="title">返回值</h3>
|
||
<p class="para">
|
||
<span class="function"><strong>eio_statvfs()</strong></span> returns request resource on success or
|
||
<strong><code>FALSE</code></strong> on error. On success assigns <code class="parameter">result</code> argument of
|
||
<code class="parameter">callback</code> to an array.
|
||
</p>
|
||
</div>
|
||
|
||
|
||
<div class="refsect1 examples" id="refsect1-function.eio-statvfs-examples">
|
||
<h3 class="title">范例</h3>
|
||
<div class="example" id="example-4290">
|
||
<p><strong>Example #1 <span class="function"><strong>eio_statvfs()</strong></span> example</strong></p>
|
||
<div class="example-contents">
|
||
<div class="phpcode"><pre><span style="color: #000000">
|
||
<span style="color: #0000BB"><?php<br />$tmp_filename </span><span style="color: #007700">= </span><span style="color: #DD0000">'/tmp/eio-file.tmp'</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">touch</span><span style="color: #007700">(</span><span style="color: #0000BB">$tmp_filename</span><span style="color: #007700">);<br /><br />function </span><span style="color: #0000BB">my_statvfs_callback</span><span style="color: #007700">(</span><span style="color: #0000BB">$data</span><span style="color: #007700">, </span><span style="color: #0000BB">$result</span><span style="color: #007700">) {<br /> </span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">$data</span><span style="color: #007700">);<br /> </span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">$result</span><span style="color: #007700">);<br /><br /> @</span><span style="color: #0000BB">unlink</span><span style="color: #007700">(</span><span style="color: #0000BB">$data</span><span style="color: #007700">);<br />}<br /><br /></span><span style="color: #0000BB">eio_statvfs</span><span style="color: #007700">(</span><span style="color: #0000BB">$tmp_filename</span><span style="color: #007700">, </span><span style="color: #0000BB">EIO_PRI_DEFAULT</span><span style="color: #007700">, </span><span style="color: #DD0000">"my_statvfs_callback"</span><span style="color: #007700">, </span><span style="color: #0000BB">$tmp_filename</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">eio_event_loop</span><span style="color: #007700">();<br /></span><span style="color: #0000BB">?></span>
|
||
</span>
|
||
</pre></div>
|
||
</div>
|
||
|
||
<div class="example-contents"><p>以上例程的输出类似于:</p></div>
|
||
<div class="example-contents screen">
|
||
<div class="cdata"><pre>
|
||
string(17) "/tmp/eio-file.tmp"
|
||
array(11) {
|
||
["f_bsize"]=>
|
||
int(4096)
|
||
["f_frsize"]=>
|
||
int(4096)
|
||
["f_blocks"]=>
|
||
int(262144)
|
||
["f_bfree"]=>
|
||
int(262111)
|
||
["f_bavail"]=>
|
||
int(262111)
|
||
["f_files"]=>
|
||
int(1540815)
|
||
["f_ffree"]=>
|
||
int(1540743)
|
||
["f_favail"]=>
|
||
int(1540743)
|
||
["f_fsid"]=>
|
||
int(0)
|
||
["f_flag"]=>
|
||
int(4102)
|
||
["f_namemax"]=>
|
||
int(255)
|
||
}
|
||
</pre></div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
|
||
|
||
</div></div></div></body></html> |