Re: [PHP-DEV] Re: PHP 4.0 Bug #7396 Updated: is_dir() doesn't work From: Whit (whit <email protected>)
Date: 10/27/00

Andi,

Until about half-way through the PHP 3.x series, if you did an opendir and
then a readdir and then tested that result with an is_dir or is_file you
were fine. But then it became necessary to do a chdir as an intermediate
step.

PHP used to assume that the file you were testing was in the last directory
you'd openned. Then it changed to assuming that the file is in the directory
the PHP script is in. (Don't know whether opendir did an implicit chdir, or
whether this was passed some other way.) I don't think either is 'wrong,'
but the old behavior is what some people more naturally expect, and it would
save those of us who expect the old, perhaps more intuitive, certainly
lazier, behavior some trouble if the manual added a line to the is_dir and
is_file function descriptions to clarify the present scheme.

I tripped over the change a year ago myself, but forgot about it until I
tripped over it again last week - and in the annotated manual there were
notes from other people having what looked like the same problem (plus an
old note in one place I'd put there last year, and forgotten ... sigh).

Whit

PS: Also, the division in the manual between the Directory and File
functions is confused - chdir under Directory functions and mkdir under
File - and from the comments people are not always finding both sections.

On Fri, Oct 27, 2000 at 12:54:18PM +0200, Andi Gutmans wrote:
> Can you explain the problem again without long examples? (Two lines if
> possible).
> What doesn't work?
>
> Andi

 \/\/ I-I I T
 Blauvelt
 whit <email protected>

-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: php-dev-unsubscribe <email protected>
For additional commands, e-mail: php-dev-help <email protected>
To contact the list administrators, e-mail: php-list-admin <email protected>