php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #14420 is_file prints "stat failed .." message
Submitted: 2001-12-11 04:01 UTC Modified: 2001-12-12 20:37 UTC
From: evsvit at hotmail dot com Assigned:
Status: Closed Package: Scripting Engine problem
PHP Version: 4.1.0 OS: Redhat Linux
Private report: No CVE-ID: None
 [2001-12-11 04:01 UTC] evsvit at hotmail dot com
We have found it out when upgraded our PHP from ver.4.0.1 to 4.1.0 . Function is_file() prints error message if file doesn't exist. The error message looks like:
"Warning: stat failed for /home/.../index.phtml (errno=2 - No such file or directory) in /home/.../index.phtml on line 17"
When I tried to simulate the problem in test file - it didn't appear . But then I included my configuration file which contained other inclusions for our corporate API. Problem appeared in the test file. I commented inclusion line - problem still appear.
After typing the message above, I refreshed that page - problem disappeared. All further tryings to cause error got failed.
Problem appears constanlty on our sites where we use this function.

Patches

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-12-11 17:28 UTC] mfischer@php.net
Please check if you changed the error_reporting() level.

Feedback.
 [2001-12-11 21:05 UTC] yohgaki@php.net
This has been discussed, but I don't remeber the conclusion.
Anyone remember that?

I think we need consistent rule for error messages....

Status = Duplicate
 [2001-12-11 21:33 UTC] evsvit at hotmail dot com
Here is my conversation with Mike Rodgers. Maybe it will help to remember the conclusion of previous discussion.

Agreed.
    These changes should be made into toggles.  If you ask me, if the file
doesn't exist, it's not a file.  That shouldn't be an error message.
--
Mike

----- Original Message -----
From: "Vitali Evstigneev" <evsvit@hotmail.com>
To: "Mike Rogers" <temp6453@hotmail.com>; <php-dev@lists.php.net>
Sent: Tuesday, December 11, 2001 9:41 PM
Subject: Re: [PHP-DEV] Bug #14420: is_file prints "stat failed .." message


>
> Hello Mike!
> Thanks for responding. I'm affraid I haven't described problem well
enough.
> Function is_file() still returns FALSE. But in the same time it types
error
> message to output. It doesn't affect program's flow but affects interface.
I
> understand that if we parse name "is_file" then function seems to be
> assuming that  argument  points either to existing file or folder or link.
> That's true amd I'm agree with you. We should use file_exists() first. But
> I'm talking about different thing. I'm talking about compatibility of code
> written on lower version with higher version i.e. "succession of
versions".
> "is_file()" was written very long time ago, and it was working by some
way.
> People used that function and they knew that it works fine. Now, because
of
> our wish to make PHP language more beautiful and logically perfect, those
> people have to change tonns of code. Some code has been frosen for changes
> and they have to make more paper work to get approval from management for
> making changes and so one and so forth. Why don't we leave working
function
> in it's previous state and achieve succession of versions by that?
>
> Regards,
> Vitali
>
> ----- Original Message -----
> From: "Mike Rogers" <temp6453@hotmail.com>
> To: <php-dev@lists.php.net>; <evsvit@hotmail.com>
> Sent: Wednesday, December 12, 2001 7:16 AM
> Subject: Re: [PHP-DEV] Bug #14420: is_file prints "stat failed .." message
>
>
> > This has been changed.  Use exists() first.  Technically, if the file
does
> > exist, it's not a file in my opinion and should return false, but nobody
> > seems to agree with me.
> > --
> > Mike
> >

 [2001-12-12 11:38 UTC] sniper@php.net
This is fixed in CVS. 

--Jani

 [2001-12-12 20:37 UTC] evsvit at hotmail dot com
Same problem appeared with is_dir() function. In this case I think we should check is_readable(), is_writable() and is_writeable() functions as well.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Aug 03 03:01:30 2024 UTC