Jump to content

clearstatcache not working?


macworks

Recommended Posts

Okay I'm building a PHP driven document library where users can upload and download documents, create folders, sub-folders, etc.

I discovered that I needed to use clearstatcache to force PHP to actually look at the file system to determine if a file exists or if an item is a directory / folder. But when I remove files from the folder, PHP still thinks that the item is there when I use is_readable or is_dir or file_exists. I even went so far as to upgrade PHP from 5.1.4 to 5.1.6 and I restarted Apache too.

Does anyone have any insight on this?

In case you are wondering, my document library uses a database to store the list of document with some additional meta-data, so when a user visits a doc lib folder, PHP grabs records from the database to see which files are in the directory, then checks the file system to make sure that the files are actually there.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.