#21410 [Opn]: filetype() shows 'dir' for bogus files on windows
| From: | philip@php.net | Date: | Sat, 04 Jan 2003 21:30:34 +0000 |
| Subject: | #21410 [Opn]: filetype() shows 'dir' for bogus files on windows | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-29069@lists.php.net to get a copy of this message | ||
ID: 21410
Updated by: philip@php.net
Reported By: ari@alienhosting.com
Status: Open
Bug Type: Filesystem function related
Operating System: win
PHP Version: 4.3.0
New Comment:
To be clearer: This happens with any bogus information, whether it be
a string, NULL, or otherwise.
Of course passing no arguments still results in the standard wrong
parameter count error.
Previous Comments:
------------------------------------------------------------------------
[2003-01-04 15:12:16] philip@php.net
I experience this E_WARNING in linux but in Windows I always get the
following with 4.3.0/win2000:
var_dump( filetype(null) ); // string(3) "dir"
Which seems odd. Basically instead of the E_WARNING error it shows the
bogus file as a dir. This happens with CGI, CLI, and Apache2.
Marking this as a filesystem bug.
------------------------------------------------------------------------
[2003-01-04 14:43:23] nicos@php.net
The documentation now warns about the warnings :-)
Thank you for your report.
------------------------------------------------------------------------
[2003-01-04 14:37:31] nicos@php.net
Changing this bug to a documentation problem.
The warning are now expected for 2 cases: when stat or lstat have
failed and when the file type is unknown.
I'm working on fixing the documentation.
------------------------------------------------------------------------
[2003-01-04 13:29:51] ari@alienhosting.com
In the filetype() doc, it says the function returns FALSE on error, but
says nothing about a warning being output if it fails. In 4.3.0, A
warning is printed:
Warning: filetype() [function.filetype]: Lstat failed for (null)
(errno=2 - No such file or directory) in
/home/alienhosting/public_html/webmail/plugins/administrator/options.php
on line 431
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=21410&edit=1