PHPclearstatcache () function

Source: Internet
Author: User
Define and use the clearstatcache () function to clear the file status cache. The clearstatcache () function caches the returned information of some functions to provide higher performance. However, sometimes, for example, checking the definition and usage of the same file multiple times in a script

The clearstatcache () function clears the file status cache.

The clearstatcache () function caches the returned information of some functions to provide higher performance. But sometimes, for example, if you check the same file multiple times in a script and the file is in danger of being deleted or modified during script execution, you need to clear the file status cache, to get the correct results. To do this, you need to use the clearstatcache () function.

The cached function, that is, the function affected by the clearstatcache () function:

  • Stat ()
  • Lstat ()
  • File_exists ()
  • Is_writable ()
  • Is_readable ()
  • Is_executable ()
  • Is_file ()
  • Is_dir ()
  • Is_link ()
  • Filectime ()
  • Fileatime ()
  • Filemtime ()
  • Fileinode ()
  • Filegroup ()
  • Fileowner ()
  • Filesize ()
  • Filetype ()
  • Fileperms ()
Syntax
Clearstatcache ()
Example
 

Output:

792100

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.