Bug #15089: stat() produces warning instead of error-code.
| From: | herp at wildsau dot idv dot uni-linz dot ac dot at | Date: | Thu, 17 Jan 2002 21:29:39 +0000 |
| Subject: | Bug #15089: stat() produces warning instead of error-code. | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-77370@lists.php.net to get a copy of this message | ||
From: herp@wildsau.idv.uni-linz.ac.at
Operating system: linux
PHP version: 4.1.1
PHP Bug Type: Unknown/Other Function
Bug description: stat() produces warning instead of error-code.
I used stat() to check the existence of files. If the file I check does
not
exist, stat() would return FALSE instead of a struct stbuf. This behaviour
is also the *documented* behaviour and is how php-4.0 behaves.
Just 15 mins. ago I installed php-4.1.1. Now, stat() on a non-existent
file clutters my html-pages with "Warning: file does not exist". *cough*
Yes, I know that files might not exist, that´s exactly what I use stat()
for, to check the existance of files. Yes, there is "file_exists()", but
why do you output warnings from stat() when returning FALSE is
sufficient? This is one more step away from how one would code
programms in C. Why implement C-like functions (stat(), fstat(), lstat())
when you have to use other non-obvious functions (file_exists())
to do what you could do with the C-like functions. Stay close to the
origins.
--
Edit bug report at: http://bugs.php.net/?id=15089&edit=1