<!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>Returns the values most recently detected by Ev</title> </head> <body><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="class.evstat.html">EvStat</a></div> <div class="next" style="text-align: right; float: right;"><a href="evstat.construct.html">EvStat::__construct</a></div> <div class="up"><a href="class.evstat.html">EvStat</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div><hr /><div id="evstat.attr" class="refentry"> <div class="refnamediv"> <h1 class="refname">EvStat::attr</h1> <p class="verinfo">(PECL ev >= 0.2.0)</p><p class="refpurpose"><span class="refname">EvStat::attr</span> — <span class="dc-title">Returns the values most recently detected by Ev</span></p> </div> <div class="refsect1 description" id="refsect1-evstat.attr-description"> <h3 class="title">Description</h3> <div class="methodsynopsis dc-description"> <span class="modifier">public</span> <span class="type">array</span> <span class="methodname"><strong>EvStat::attr</strong></span> ( <span class="methodparam">void</span> )</div> <p class="para rdfs-comment"> Returns array of the values most recently detected by Ev </p> </div> <div class="refsect1 parameters" id="refsect1-evstat.attr-parameters"> <h3 class="title">Parameters</h3> <p class="para">This function has no parameters.</p> </div> <div class="refsect1 returnvalues" id="refsect1-evstat.attr-returnvalues"> <h3 class="title">Return Values</h3> <p class="para"> Returns array with the values most recently detect by Ev(without actual <em>stat</em> 'ing): <table class="doctable table"> <caption><strong> List for item keys of the array returned by <span class="methodname"><strong>EvStat::attr()</strong></span> </strong></caption> <thead> <tr> <th>Key</th> <th>Description</th> </tr> </thead> <tbody class="tbody"> <tr> <td> <strong><code>'dev'</code></strong> </td> <td>ID of device containing file</td> </tr> <tr> <td> <strong><code>'ino'</code></strong> </td> <td>inode number</td> </tr> <tr> <td> <strong><code>'mode'</code></strong> </td> <td>protection</td> </tr> <tr> <td> <strong><code>'nlink'</code></strong> </td> <td>number of hard links</td> </tr> <tr> <td> <strong><code>'uid'</code></strong> </td> <td>user ID of owner</td> </tr> <tr> <td> <strong><code>'size'</code></strong> </td> <td>total size, in bytes</td> </tr> <tr> <td> <strong><code>'gid'</code></strong> </td> <td>group ID of owner</td> </tr> <tr> <td> <strong><code>'rdev'</code></strong> </td> <td>device ID (if special file)</td> </tr> <tr> <td> <strong><code>'blksize'</code></strong> </td> <td>blocksize for file system I/O</td> </tr> <tr> <td> <strong><code>'blocks'</code></strong> </td> <td>number of 512B blocks allocated</td> </tr> <tr> <td> <strong><code>'atime'</code></strong> </td> <td>time of last access</td> </tr> <tr> <td> <strong><code>'ctime'</code></strong> </td> <td>time of last status change</td> </tr> <tr> <td> <strong><code>'mtime'</code></strong> </td> <td>time of last modification</td> </tr> </tbody> </table> </p> <p class="para"> See <em>stat(2)</em> man page for details. </p> </div> <div class="refsect1 examples" id="refsect1-evstat.attr-examples"> <h3 class="title">Examples</h3> <div class="example" id="example-3631"> <p><strong>Example #1 Monitor changes of /var/log/messages</strong></p> <div class="example-contents"> <div class="phpcode"><code><span style="color: #000000"> <span style="color: #0000BB"><?php<br /></span><span style="color: #FF8000">// Use 10 second update interval.<br /></span><span style="color: #0000BB">$w </span><span style="color: #007700">= new </span><span style="color: #0000BB">EvStat</span><span style="color: #007700">(</span><span style="color: #DD0000">"/var/log/messages"</span><span style="color: #007700">, </span><span style="color: #0000BB">8</span><span style="color: #007700">, function (</span><span style="color: #0000BB">$w</span><span style="color: #007700">) {<br /> echo </span><span style="color: #DD0000">"/var/log/messages changed\n"</span><span style="color: #007700">;<br /><br /> </span><span style="color: #0000BB">$attr </span><span style="color: #007700">= </span><span style="color: #0000BB">$w</span><span style="color: #007700">-></span><span style="color: #0000BB">attr</span><span style="color: #007700">();<br /><br /> if (</span><span style="color: #0000BB">$attr</span><span style="color: #007700">[</span><span style="color: #DD0000">'nlink'</span><span style="color: #007700">]) {<br /> </span><span style="color: #0000BB">printf</span><span style="color: #007700">(</span><span style="color: #DD0000">"Current size: %ld\n"</span><span style="color: #007700">, </span><span style="color: #0000BB">$attr</span><span style="color: #007700">[</span><span style="color: #DD0000">'size'</span><span style="color: #007700">]);<br /> </span><span style="color: #0000BB">printf</span><span style="color: #007700">(</span><span style="color: #DD0000">"Current atime: %ld\n"</span><span style="color: #007700">, </span><span style="color: #0000BB">$attr</span><span style="color: #007700">[</span><span style="color: #DD0000">'atime'</span><span style="color: #007700">]);<br /> </span><span style="color: #0000BB">printf</span><span style="color: #007700">(</span><span style="color: #DD0000">"Current mtime: %ld\n"</span><span style="color: #007700">, </span><span style="color: #0000BB">$attr</span><span style="color: #007700">[</span><span style="color: #DD0000">'mtime'</span><span style="color: #007700">]);<br /> } else {<br /> </span><span style="color: #0000BB">fprintf</span><span style="color: #007700">(</span><span style="color: #0000BB">STDERR</span><span style="color: #007700">, </span><span style="color: #DD0000">"`messages` file is not there!"</span><span style="color: #007700">);<br /> </span><span style="color: #0000BB">$w</span><span style="color: #007700">-></span><span style="color: #0000BB">stop</span><span style="color: #007700">();<br /> }<br />});<br /><br /></span><span style="color: #0000BB">Ev</span><span style="color: #007700">::</span><span style="color: #0000BB">run</span><span style="color: #007700">();<br /></span><span style="color: #0000BB">?></span> </span> </code></div> </div> </div> </div> <div class="refsect1 seealso" id="refsect1-evstat.attr-seealso"> <h3 class="title">See Also</h3> <ul class="simplelist"> <li class="member"> <span class="methodname"><a href="evstat.prev.html" class="methodname" rel="rdfs-seeAlso">EvStat::prev()</a> - Returns the previous set of values returned by EvStat::attr</span> </li> <li class="member"> <span class="methodname"><a href="evstat.stat.html" class="methodname" rel="rdfs-seeAlso">EvStat::stat()</a> - Initiates the stat call</span> </li> </ul> </div> </div><hr /><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="class.evstat.html">EvStat</a></div> <div class="next" style="text-align: right; float: right;"><a href="evstat.construct.html">EvStat::__construct</a></div> <div class="up"><a href="class.evstat.html">EvStat</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div></body></html>