php-doc-en/reference/filesystem/functions/stat.xml
Derick Rethans a09f981d33 - Structural changes
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@131877 c90b9560-bf6c-de11-be94-00142212c4b1
2003-06-16 12:57:32 +00:00

153 lines
4.2 KiB
XML

<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.8 $ -->
<!-- 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 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 (i.e. Windows) return -1.
</para>
&note.clearstatcache;
&note.no-remote;
<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
-->