Bug #841 Updated: basename() & dirname() do not parse path correctly
| From: | Bug Database | Date: | Mon, 21 Dec 1998 19:06:04 +0000 |
| Subject: | Bug #841 Updated: basename() & dirname() do not parse path correctly | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-2969@lists.php.net to get a copy of this message | ||
ID: 841
Updated by: rasmus
Reported By: inlan@flash.net
Status: Closed
Bug Type: Misbehaving function
Assigned To:
Comments:
The correct operations of these functions should be...
dirname returns everything PRIOR to the last / or \ in the path.
basename returns everything AFTER the last / or \ in the path.
Reason for this is that we do not stat the file to check if it exists. There are uses for these
functions even in the case the directory or file is no there. Therefor, we have no way to know if
in some instances,
such as 'something' or '/something', it is a directory or file being refered to,
even if there is a dot in the string, directories can also have dots. So it is a matter of best
guess.
Any other developers have comments?
I agree with this assessment. And as the original ChangeLog entry stated, it is similar to the
Bourne shell versions by the same names. The functionality described above might be useful as a
separate set of functions, but I would not consider it a bug in basename/dirname.
Full Bug description available at: http://ca.php.net/bugs.php3?id=841
--
PHP Development Mailing List http://www.php.net/
To unsubscribe send an empty message to php-dev-unsubscribe@lists.php.net
For help: php-dev-help@lists.php.net