Doc #53401 [Opn->Csd]: dirname() and basename() documentation unclear/incorrect for Windows

From: Date: Thu, 10 Feb 2011 14:30:43 +0000
Subject: Doc #53401 [Opn->Csd]: dirname() and basename() documentation unclear/incorrect for Windows
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-5957@lists.php.net to get a copy of this message
Edit report at http://bugs.php.net/bug.php?id=53401&edit=1 ID: 53401 Updated by: vrana@php.net Reported by: chealer at gmail dot com Summary: dirname() and basename() documentation unclear/incorrect for Windows -Status: Open +Status: Closed Type: Documentation Problem Package: Documentation problem PHP Version: Irrelevant -Assigned To: +Assigned To: vrana Block user comment: N Private report: 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. I've clarified the dirname() example, other parts are good. Previous Comments: ------------------------------------------------------------------------ [2010-11-25 00:00:12] chealer at gmail dot com Description: ------------ Hi, earlier I reported http://bugs.php.net/bug.php?id=51830 about the documentation for basename and dirname, which was mostly addressed by revision 305142, 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. The output given for the examples is correct on UNIX, but not on Windows, where this is the actual output: 1) /etc 2) \ 3) . So 2) outputs a backslash instead of a slash. 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 http://bugs.php.net/bug.php?id=53401&edit=1

« previous php.doc.bugs (#5957) next »