<!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><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="function.eio-stat.html">eio_stat</a></div> <div class="next" style="text-align: right; float: right;"><a href="function.eio-symlink.html">eio_symlink</a></div> <div class="up"><a href="ref.eio.html">Eio Functions</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div><hr /><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">Description</h3> <div class="methodsynopsis dc-description"> <span class="type">resource</span> <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> ] )</div> <p class="para rdfs-comment"> <span class="function"><strong>eio_statvfs()</strong></span> returns file system statistics information in <em><code class="parameter">result</code></em> argument of <em><code class="parameter">callback</code></em> </p> </div> <div class="refsect1 parameters" id="refsect1-function.eio-statvfs-parameters"> <h3 class="title">Parameters</h3> <dl> <dt> <span class="term"><em><code class="parameter">path</code></em></span> <dd> <p class="para"> Pathname of any file within the mounted file system </p> </dd> </dt> <dt> <span class="term"><em><code class="parameter">pri</code></em></span> <dd> <p class="para">The request priority: <strong><code>EIO_PRI_DEFAULT</code></strong>, <strong><code>EIO_PRI_MIN</code></strong>, <strong><code>EIO_PRI_MAX</code></strong>, or <strong><code>NULL</code></strong>. If <strong><code>NULL</code></strong> passed, <em><code class="parameter">pri</code></em> internally is set to <strong><code>EIO_PRI_DEFAULT</code></strong>. </p> </dd> </dt> <dt> <span class="term"><em><code class="parameter">callback</code></em></span> <dd> <p class="para"> <em><code class="parameter">callback</code></em> function is called when the request is done. It should match the following prototype: <div class="example-contents"><div class="phpcode"><code><span style="color: #000000"> void callback(mixed $data, int $result[, resource $req]);</span> </code></div></div> <dl> <dt> <span class="term"><em><code class="parameter">data</code></em></span> <dd> <p class="para">is custom data passed to the request.</p></dd> </dt> <dt> <span class="term"><em><code class="parameter">result</code></em></span> <dd> <p class="para">request-specific result value; basically, the value returned by corresponding system call.</p></dd> </dt> <dt> <span class="term"><em><code class="parameter">req</code></em></span> <dd> <p class="para">is optional request resource which can be used with functions like <span class="function"><a href="function.eio-get-last-error.html" class="function">eio_get_last_error()</a></span></p></dd> </dt> </dl> </p> </dd> </dt> <dt> <span class="term"><em><code class="parameter">data</code></em></span> <dd> <p class="para"> Arbitrary variable passed to <em><code class="parameter">callback</code></em>. </p> </dd> </dt> </dl> </div> <div class="refsect1 returnvalues" id="refsect1-function.eio-statvfs-returnvalues"> <h3 class="title">Return Values</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 <em><code class="parameter">result</code></em> argument of <em><code class="parameter">callback</code></em> to an array. </p> </div> <div class="refsect1 examples" id="refsect1-function.eio-statvfs-examples"> <h3 class="title">Examples</h3> <div class="example" id="example-3608"> <p><strong>Example #1 <span class="function"><strong>eio_statvfs()</strong></span> example</strong></p> <div class="example-contents"> <div class="phpcode"><code><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> </code></div> </div> <div class="example-contents"><p>The above example will output something similar to:</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><hr /><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="function.eio-stat.html">eio_stat</a></div> <div class="next" style="text-align: right; float: right;"><a href="function.eio-symlink.html">eio_symlink</a></div> <div class="up"><a href="ref.eio.html">Eio Functions</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div></body></html>