2002-04-15 00:12:54 +00:00
|
|
|
<?xml version="1.0" encoding="iso-8859-1"?>
|
2003-05-09 23:18:26 +00:00
|
|
|
<!-- $Revision: 1.6 $ -->
|
2002-04-15 00:12:54 +00:00
|
|
|
<!-- 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>
|
2003-02-22 18:55:36 +00:00
|
|
|
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>
|
2003-05-09 21:42:28 +00:00
|
|
|
In case of error, <function>stat</function> returns &false;. It also
|
|
|
|
will throw a warning.
|
2002-04-15 00:12:54 +00:00
|
|
|
</para>
|
|
|
|
<para>
|
|
|
|
Returns an array with the statistics of the file with the
|
2003-05-09 21:42:28 +00:00
|
|
|
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:
|
2003-05-09 23:18:26 +00:00
|
|
|
<itemizedlist>
|
2003-05-09 21:42:28 +00:00
|
|
|
<listitem>
|
|
|
|
<simpara>
|
2003-05-09 23:18:26 +00:00
|
|
|
0 : device (can also be accessed as <literal>dev</literal>)
|
2003-05-09 21:42:28 +00:00
|
|
|
</simpara>
|
|
|
|
</listitem>
|
|
|
|
<listitem>
|
|
|
|
<simpara>
|
2003-05-09 23:18:26 +00:00
|
|
|
1 : inode (can also be accessed as <literal>ino</literal>)
|
2003-05-09 21:42:28 +00:00
|
|
|
</simpara>
|
|
|
|
</listitem>
|
|
|
|
<listitem>
|
|
|
|
<simpara>
|
2003-05-09 23:18:26 +00:00
|
|
|
2 : inode protection mode (can also be accessed as <literal>mode</literal>)
|
2003-05-09 21:42:28 +00:00
|
|
|
</simpara>
|
|
|
|
</listitem>
|
|
|
|
<listitem>
|
|
|
|
<simpara>
|
2003-05-09 23:18:26 +00:00
|
|
|
3 : number of links (can also be accessed as <literal>nlink</literal>)
|
2003-05-09 21:42:28 +00:00
|
|
|
</simpara>
|
|
|
|
</listitem>
|
|
|
|
<listitem>
|
|
|
|
<simpara>
|
2003-05-09 23:18:26 +00:00
|
|
|
4 : user id of owner (can also be accessed as <literal>uid</literal>)
|
2003-05-09 21:42:28 +00:00
|
|
|
</simpara>
|
|
|
|
</listitem>
|
|
|
|
<listitem>
|
|
|
|
<simpara>
|
2003-05-09 23:18:26 +00:00
|
|
|
5 : group id owner (can also be accessed as <literal>gid</literal>)
|
2003-05-09 21:42:28 +00:00
|
|
|
</simpara>
|
|
|
|
</listitem>
|
|
|
|
<listitem>
|
|
|
|
<simpara>
|
2003-05-09 23:18:26 +00:00
|
|
|
6 : device type if inode device (can also be accessed as <literal>rdev
|
2003-05-09 21:42:28 +00:00
|
|
|
</literal>) *
|
|
|
|
</simpara>
|
|
|
|
</listitem>
|
|
|
|
<listitem>
|
|
|
|
<simpara>
|
2003-05-09 23:18:26 +00:00
|
|
|
7 : size in bytes (can also be accessed as <literal>size</literal>)
|
2003-05-09 21:42:28 +00:00
|
|
|
</simpara>
|
|
|
|
</listitem>
|
|
|
|
<listitem>
|
|
|
|
<simpara>
|
2003-05-09 23:18:26 +00:00
|
|
|
8 : time of last access (can also be accessed as <literal>atime</literal>)
|
2003-05-09 21:42:28 +00:00
|
|
|
</simpara>
|
|
|
|
</listitem>
|
|
|
|
<listitem>
|
|
|
|
<simpara>
|
2003-05-09 23:18:26 +00:00
|
|
|
9 : time of last modification (can also be accessed as <literal>mtime
|
2003-05-09 21:42:28 +00:00
|
|
|
</literal>)
|
|
|
|
</simpara>
|
|
|
|
</listitem>
|
|
|
|
<listitem>
|
|
|
|
<simpara>
|
2003-05-09 23:18:26 +00:00
|
|
|
10 : time of last change (can also be accessed as <literal>ctime</literal>)
|
2003-05-09 21:42:28 +00:00
|
|
|
</simpara>
|
|
|
|
</listitem>
|
|
|
|
<listitem>
|
|
|
|
<simpara>
|
2003-05-09 23:18:26 +00:00
|
|
|
11 : blocksize for filesystem I/O (can also be accessed as
|
2003-05-09 21:50:16 +00:00
|
|
|
<literal>blksize</literal>) *
|
2003-05-09 21:42:28 +00:00
|
|
|
</simpara>
|
|
|
|
</listitem>
|
|
|
|
<listitem>
|
|
|
|
<simpara>
|
2003-05-09 23:18:26 +00:00
|
|
|
12 : number of blocks allocated (can also be accessed as
|
2003-05-09 21:42:28 +00:00
|
|
|
<literal>blocks</literal>)
|
|
|
|
</simpara>
|
|
|
|
</listitem>
|
2003-05-09 23:18:26 +00:00
|
|
|
</itemizedlist>
|
2002-04-15 00:12:54 +00:00
|
|
|
* - only valid on systems supporting the st_blksize type--other
|
|
|
|
systems (i.e. Windows) return -1.
|
|
|
|
</para>
|
2003-02-22 18:55:36 +00:00
|
|
|
|
|
|
|
¬e.clearstatcache;
|
|
|
|
|
|
|
|
¬e.no-remote;
|
|
|
|
|
2002-04-15 00:12:54 +00:00
|
|
|
<para>
|
2003-02-22 18:55:36 +00:00
|
|
|
See also <function>lstat</function>,
|
|
|
|
<function>filemtime</function>, and
|
|
|
|
<function>filegroup</function>.
|
2002-04-15 00:12:54 +00:00
|
|
|
</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
|
|
|
|
-->
|