Rewrote description of this function for clarity (check user notes -- no one knew what this function actually did. ;)

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@94828 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Erica Douglass 2002-09-06 06:43:13 +00:00
parent a48ea8e573
commit 6b3c8a6e6c

View file

@ -1,10 +1,10 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.2 $ -->
<!-- splitted from ./en/functions/filesystem.xml, last change in rev 1.2 -->
<!-- $Revision: 1.3 $ -->
<!-- split from ./en/functions/filesystem.xml, last change in rev 1.2 -->
<refentry id="function.clearstatcache">
<refnamediv>
<refname>clearstatcache</refname>
<refpurpose>Clears file stat cache</refpurpose>
<refpurpose>Clears file status cache</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
@ -12,18 +12,20 @@
<type>void</type><methodname>clearstatcache</methodname>
<void/>
</methodsynopsis>
<para>
Invoking the <systemitem>stat</systemitem> or
<systemitem>lstat</systemitem> system call on most systems is
quite expensive. Therefore, the result of the last call to any of
the status functions (listed below) is stored for use on the next
such call using the same filename. If you wish to force a new
status check, for instance if the file is being checked many
times and may change or disappear, use this function to clear the
results of the last call from memory.
<para>
When you use <methodname>stat()</methodname>, <methodname>lstat()</methodname>, or any of the other functions listed in the affected functions
list (below), PHP caches the information those functions return in order to provide faster
performance. However, in certain cases, you may want to clear the cached information. For
instance, if the same file is being checked multiple times within a single script, and that file
is in danger of being removed or changed during that script's operation, you may elect to clear the
status cache. In these cases, you can use the <methodname>clearstatcache()</methodname> function to clear the information that PHP caches about a file.
</para>
<para>
This value is only cached for the lifetime of a single request.
<note>
<para>
This function caches information about specific filenames, so you only need to call <methodname>clearstatcache()</methodname> if
you are performing multiple operations on the same filename and require the information about that
particular file to not be cached.
</note>
</para>
<para>
Affected functions include <function>stat</function>,