Warning: stat failed - Why does it appear?
| From: | Kasper Skårhøj | Date: | Tue, 18 Sep 2001 20:39:28 +0000 |
| Subject: | Warning: stat failed - Why does it appear? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-67740@lists.php.net to get a copy of this message | ||
Hi folks.
I have a project with over 270 is_dir, is_file and file-exists function calls.
On unix there are no problems.
On windows (WINNT/PHP Version 4.0.7-dev) these functions may return a warning like:
Warning: stat failed for log.txt (errno=2 - No such file or directory) in
D:\wwwroot\testsite-32b2\tslib\class.tslib_fe.php on line 711
This warning is typically returned if I check whether a file exists but it turns out that not only
the file does not exist, the path does not exist!
Now, there are two solutions I can't use:
1) I will not set error_reporting to exclude warnings, because PHP should to the best of my
knowledge not at all bother about these things
2) I will not place a @ in front of every function which would potentially return this error.
And furthermore I'm puzzled why this error apparently is only on Windows, not on Unix and
certainly has not always been there since I remember earlier when this project did not impose any
problems.
So what's up here? Why is this warning justified? And how do I avoid it?
Thanks a lot
(Kasper Skårhøj, Typo3 developer)
Best regards and God's blessings
- kasper
-------------------- o ---------------------
Were you taught the Earth was flat? Not so! See --->>> www.answersInGenesis.org
Check www.typo3.com