Date: 04/30/01
- Next message: laxman_lawande <email protected>: "[PHP-DEV] Bug #10556: php does not work with php_mcrypt.dll"
- Previous message: Andi Gutmans: "RE: [PHP-DEV] 4.0.6"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
ID: 9780
Updated by: andi
Reported By: fabiankessler <email protected>
Old-Status: Open
Status: Closed
Bug Type: Directory function related
PHP Version: 4.0.4
Assigned To:
Comments:
This is not a bug but the behavior of dirname is copied from the UNIX dirname command. The semantics is that it assumes it is getting a path to a file and it strips the first filename and gives you the rest of the path. It doesn't check if the file is really a directory or not. So the following is the behavior:
dirname /tmp/ = /
dirname /tmp/foo.php = /tmp
dirname /tmo/. = /tmp (it assumes . is the filename)
It really has nothing to do with the trailing / of realpath.
Previous Comments:
---------------------------------------------------------------------------
[2001-03-16 05:19:36] fabiankessler <email protected>
echo dirname(realpath("f:/dir 790/asdf/"));
this prints out "f:dir 790"
and when you do dirname() on this again, well, ...
the problem is that realpath doesn't return the trailing slash so everything else treats asdf as a file
fab
---------------------------------------------------------------------------
ATTENTION! Do NOT reply to this email!
To reply, use the web interface found at http://bugs.php.net/?id=9780&edit=2
-- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: php-dev-unsubscribe <email protected> For additional commands, e-mail: php-dev-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>
- Next message: laxman_lawande <email protected>: "[PHP-DEV] Bug #10556: php does not work with php_mcrypt.dll"
- Previous message: Andi Gutmans: "RE: [PHP-DEV] 4.0.6"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

