Doc #54536 [Csd]: dirname() and basename() documentation unclear/incorrect for Windows
| From: | chealer at gmail dot com | Date: | Tue, 12 Feb 2013 02:56:00 +0000 |
| Subject: | Doc #54536 [Csd]: dirname() and basename() documentation unclear/incorrect for Windows | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-9515@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=54536&edit=1
ID: 54536
User updated by: chealer at gmail dot com
Reported by: chealer at gmail dot com
Summary: dirname() and basename() documentation
unclear/incorrect for Windows
Status: Closed
Type: Documentation Problem
Package: Documentation problem
PHP Version: Irrelevant
Assigned To: googleguy
Block user comment: N
Private report: N
New Comment:
Would you please explain how this was solved?
Previous Comments:
------------------------------------------------------------------------
[2013-01-16 12:46:11] googleguy@php.net
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.
------------------------------------------------------------------------
[2011-04-15 06:31:25] chealer at gmail dot com
Description:
------------
Hi,
earlier I reported http://bugs.php.net/bug.php?id=53401 about the
documentation for basename and dirname, which was partly addressed by revision 308194, but there are
still a few issues, in particular for Windows. Again this bug report is wide.
http://www.php.net/manual/en/function.dirname.php
http://www.php.net/manual/en/function.basename.php
The basename page describes the return value:
Returns the base name of the given path.
But a path can have no basename if it has no component.
Also, the suffix parameter is described:
If the name component ends in suffix this will also be cut off.
The path can have several filename components, I suppose this should read:
If the basename ends in suffix this will also be cut off.
The dirname page has more Windows-specific issues. Problems are mostly with edge cases. The
following is said about the return value:
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.
As shown in example 2, even if there is a slash, the operation is more complex than removing a
trailing slash followed by a component. dirname can also remove a slash followed by a component
followed by a slash. And this is only valid on UNIX; on Windows backslashes are considered too.
dirname documentation refers to the parent directory, but eventually, there is no more parent
directory (like for "/").
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=54536&edit=1