Doc #51830 [Opn->Csd]: dirname() and basename() documentation unclear/incorrect
| From: | frozenfire@php.net | Date: | Sun, 07 Nov 2010 03:56:18 +0000 |
| Subject: | Doc #51830 [Opn->Csd]: dirname() and basename() documentation unclear/incorrect | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-5484@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: frozenfire@php.net
Reported by: chealer at gmail dot com
Summary: dirname() and basename() documentation
unclear/incorrect
-Status: Open
+Status: Closed
Type: Documentation Problem
Package: Documentation problem
PHP Version: Irrelevant
-Assigned To:
+Assigned To: frozenfire
Block user comment: N
New Comment:
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.
Thank you for the report, and for helping us make our documentation
better.
Previous Comments:
------------------------------------------------------------------------
[2010-11-07 04:55:47] frozenfire@php.net
Automatic comment from SVN on behalf of frozenfire
Revision: http://svn.php.net/viewvc/?view=revision&revision=305142
Log: Clarified behaviour of dirname and basename, as per bug #51830.
------------------------------------------------------------------------
[2010-10-25 22:06:35] kalle@php.net
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.
------------------------------------------------------------------------
[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