Re: is_readable fails with a variable parameter
| From: | Ashley Sheridan | Date: | Tue, 29 Sep 2015 18:07:06 +0000 |
| Subject: | Re: is_readable fails with a variable parameter | ||
| References: | 1 2 3 4 5 6 7 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-325157@lists.php.net to get a copy of this message | ||
On Tue, 2015-09-29 at 13:19 -0400, Tommy Peterson wrote:
> > That is the reason. I assumed the file already existed. is_readable is part
> > of the cache affected functions:
> >
> > http://php.net/manual/en/function.clearstatcache.php
> >
> > Try doing that and see if that makes a difference.
> >
>
> I thought of that too actually. The PHP API has a clear cache and I tried that. Didn't
> work. Never knew of clearstatcache(). But I just tried it too and there is no difference. I has to
> be the user/permissions. I will just have to wait for that sys admin guy to become available. I just
> wanted to make sure there wasn't something I was doing/not doing. Thanks for you all your help
> here.
>
>
This might seem a little redundant given that you've already checked the
string length of your path, but bear with me.
Have you compared in code (with == or ===) the variable containing the
path, and the actual path that works when you hard-code it in? It might
be something as simply daft as (I've done this more times than I care to
admit!) a typo in the actual path on the server.
I've used is_readable() a lot before, and never had it fail in quite
this way.
A final thought; is the file you're checking on a different filesystem,
maybe one that is accessed through a stream or via FUSE?
Thanks,
Ash
http://www.ashleysheridan.co.uk