1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153
|
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.13 $ -->
<!-- splitted from ./en/functions/filesystem.xml, last change in rev 1.2 -->
<refentry id="function.stat">
<refnamediv>
<refname>stat</refname>
<refpurpose>Gives information about a file</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>array</type><methodname>stat</methodname>
<methodparam><type>string</type><parameter>filename</parameter></methodparam>
</methodsynopsis>
<para>
Gathers the statistics of the file named by
<parameter>filename</parameter>. If <parameter>filename</parameter>
is a symbolic link, statistics are from the file itself, not the
symlink. <function>lstat</function> is identical to <function>
stat</function> except it would instead be based off the symlinks
status.
</para>
<para>
In case of error, <function>stat</function> returns &false;. It also
will throw a warning.
</para>
<para>
Returns an array with the statistics of the file with the
following elements. This array is zero-based. In addition to
returning these attributes in a numeric array, they can be accessed
with associative indices, as noted next to each parameter; this is
available since PHP 4.0.6:
</para>
<para>
<table>
<title><function>stat</function> and <function>fstat</function> result
format</title>
<tgroup cols="3">
<thead>
<row>
<entry>Numeric</entry>
<entry>Associative (since PHP 4.0.6)</entry>
<entry>Description</entry>
</row>
</thead>
<tbody>
<row>
<entry>0</entry>
<entry>dev</entry>
<entry>device number</entry>
</row>
<row>
<entry>1</entry>
<entry>ino</entry>
<entry>inode number</entry>
</row>
<row>
<entry>2</entry>
<entry>mode</entry>
<entry>inode protection mode</entry>
</row>
<row>
<entry>3</entry>
<entry>nlink</entry>
<entry>number of links</entry>
</row>
<row>
<entry>4</entry>
<entry>uid</entry>
<entry>userid of owner</entry>
</row>
<row>
<entry>5</entry>
<entry>gid</entry>
<entry>groupid of owner</entry>
</row>
<row>
<entry>6</entry>
<entry>rdev</entry>
<entry>device type, if inode device *</entry>
</row>
<row>
<entry>7</entry>
<entry>size</entry>
<entry>size in bytes</entry>
</row>
<row>
<entry>8</entry>
<entry>atime</entry>
<entry>time of last access (Unix timestamp)</entry>
</row>
<row>
<entry>9</entry>
<entry>mtime</entry>
<entry>time of last modification (Unix timestamp)</entry>
</row>
<row>
<entry>10</entry>
<entry>ctime</entry>
<entry>time of last inode change (Unix timestamp)</entry>
</row>
<row>
<entry>11</entry>
<entry>blksize</entry>
<entry>blocksize of filesystem IO *</entry>
</row>
<row>
<entry>12</entry>
<entry>blocks</entry>
<entry>number of blocks allocated</entry>
</row>
</tbody>
</tgroup>
</table>
* Only valid on systems supporting the st_blksize type - other
systems (e.g. Windows) return -1.
</para>
¬e.clearstatcache;
&tip.fopen-wrapper.stat;
<para>
See also <function>lstat</function>,
<function>fstat</function>,
<function>filemtime</function>, and
<function>filegroup</function>.
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->
|