|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2002-12-08 23:35 UTC] gambier dot olivier at free dot fr
Hello.
Up to 4.2.3:
dirname("c:/");
// or
dirname("c:");
// both returned '.'
in 4.3.0 RC2, we got now:
dirname("c:/");
// gives you c:\
dirname("c:");
// gives you c:
(i) I'm not sure that such path shall be used with dirname(). But after all, why not? And in fact I used it.
(ii) What's the reason for that behaviour change?
(iii) As some of my classes are now broken, will this new behaviour become the rule for the future?
Apache independent.
Standarts php.ini (recommended) and httpd.conf
Mozilla 1.2
Thanks.
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Nov 19 09:00:01 2025 UTC |
Suppose you have a file c:/file.txt and you want to open another file from the same directory. If dirname("c:/file.txt"); return '.', then fopen ("./another_file.txt") will fail because it is looking in the wrong directory, the current current directory. If it returns c:/ or c: then c: + / + file will resolve to the actual file and open it correctly.