php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #14294 is_dir() causes stat failed warning
Submitted: 2001-11-29 21:28 UTC Modified: 2001-11-30 03:13 UTC
From: mike at hbhosting dot com Assigned:
Status: Not a bug Package: Filesystem function related
PHP Version: 4.1.0 OS: FreeBSD 4.3
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: mike at hbhosting dot com
New email:
PHP Version: OS:

 

 [2001-11-29 21:28 UTC] mike at hbhosting dot com
In PHP 4.1 RC3 (non CVS release), the is_dir() function causes a warning that says "stat failed on /your/path" if the path does not exist.

This was causing havok with scripts of mine that relied on no output for errors.. Of course I just suppressed the message, but it really shouldnt be there. The function is designed to check for an existing dir, it should work without warnings!

Hopefully this can be fixed in the next release.

On a side note, PHP 4.1 (CVS version) does not install under FreeBSD 4.3. However the version available at http://www.php.net/~zeev/php-4.1.0RC3.tar.gz does work!

Thanks guys.....

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-11-30 02:42 UTC] sniper@php.net
Warnings can be supressed by setting error_reporting correctly.
Not a bug.

 [2001-11-30 02:43 UTC] sniper@php.net
(or using @ in front of  the function)

 [2001-11-30 03:13 UTC] mike at hbhosting dot com
You don't think it's odd that the function that checks to see if a directory exists returns a warning on what it's supposed to be doing??

Earlier versions of PHP did not do this, and to me that makes it a 'bug'. While yes, it can be suppressed, it should be functional in the same way previous versions of PHP worked. This in no way is a 'feature' of the function.
 [2003-03-22 10:29 UTC] project dot draco at gmx dot net
The warning occurs on some filefunctions (fopen and so on) and takes place, where you try to open a file, that does not exist or a remote-url

Type "stat failed php" into google and see, how many pages on the web are expiriencing this not-a-bug...

Furthermore this stat-making mystery seems to leed to a performance loss, as i get 10-20% loss on my system when switching to 4.3 (from4.0)

How?comes this?
 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Sun Oct 17 10:03:37 2021 UTC