Doc #51830 [Opn]: dirname() and basename() documentation unclear/incorrect
| From: | kalle@php.net | Date: | Mon, 25 Oct 2010 20:06:35 +0000 |
| Subject: | Doc #51830 [Opn]: dirname() and basename() documentation unclear/incorrect | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-5412@lists.php.net to get a copy of this message | ||
Edit report at http://bugs.php.net/bug.php?id=51830&edit=1
ID: 51830
Updated by: kalle@php.net
Reported by: chealer at gmail dot com
Summary: dirname() and basename() documentation
unclear/incorrect
Status: Open
Type: Documentation Problem
Package: Documentation problem
PHP Version: Irrelevant
Block user comment: N
New Comment:
Internally we do not use the dirname() and basename() functions from the
coreutils package, we have our own custom implementations of those in
php, see php_basename() and zend_dirname() but I do not know if those
implementations are identical to ours, so their descriptions might
differ.
I agree the basename() return description could be improved a little and
the dirname() return value could be abit more specific.
Previous Comments:
------------------------------------------------------------------------
[2010-05-14 22:41:06] chealer at gmail dot com
Description:
------------
The dirname() documentation, at
http://www.php.net/manual/en/function.dirname.php
, says that "Given a
string containing a path to a file, this function will return the name
of the directory.", This is either incomprehensible, or at best,
ambiguous. Which directory? If giving a directory pathname, one would
assume the given directory's pathname would be returned, but that is not
the case.
The basename() documentation is also wrong. It says the base name of the
file given is returned. What's returned is not the base name, but the
[POSIX] basename (without a space).
Back to dirname(), it says:
Returns the name of the directory. If there are no slashes in path, a
dot ('.') is returned, indicating the current directory. Otherwise, the
returned string is path with any trailing /component removed.
This description must be copied from the coreutils dirname manpage, on
which I filed a bug:
http://debbugs.gnu.org/cgi/bugreport.cgi?bug=6175
The POSIX manpage is better, but non-free. As an alternative, I suggest
to use coreutils dirname's info page. In addition to the issue in
coreutils dirname's manpage, the description is not adapted to Windows.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/bug.php?id=51830&edit=1