Ask a Question related to PHP Bugs, Design and Development.
-
csaba at alum dot mit dot edu #1
#17822 [Opn->Csd]: Realpath, getcwd not returning true pathname
ID: 17822
User updated by: csaba at alum dot mit dot edu
Reported By: csaba at alum dot mit dot edu
-Status: Open
+Status: Closed
Bug Type: Feature/Change Request
Operating System: Windows - all
PHP Version: 4.3.0
Assigned To: sfox
New Comment:
Hurrah! This now appears fixed.
realpath(strtolower(getcwd())) is now the same as
realpath(strtoupper(getcwd())) is now the same as
getcwd()
on my Win XP Pro under
PHP 5.2.1RC4-dev (cli) (built: Jan 25 2007 08:24:12)
Thanks,
Csaba Gabor from Vienna
Previous Comments:
------------------------------------------------------------------------
[2004-04-23 00:26:09] csaba at alum dot mit dot edu
I have tested this with the latest snapshot 5.0 RC 2 of April 22 on my
Win 2K Pro system and it is still a problem. Here are the outputs that
I get (I did an inititial print right after the first cwd() so you can
see what windows thinks the directory is):
C:\Morph\phpDev\40gNiKU5LQ0C
c:\Morph\phpDev\40gniku5lq0c
c:\Morph\phpDev\40gniku5lq0c
C:\Morph\phpDev\40GNIKU5LQ0C
C:\Morph\phpDev\40GNIKU5LQ0C
So it appears that the middle part is OK but the drive letter and the
final directory need some shoring up.
Csaba Gabor
------------------------------------------------------------------------
[2003-02-15 17:38:53] csaba at alum dot mit dot edu
I have marked this bug as open because of the demonstration below on my
PHP 4.3 build date Dec. 20, 2002; Apache 2.0.43 Filter; Win2K Pro
system.
Here is the test:
<html><head><title>getcwd Problem</title></head><body>
<?php
$cwd = getcwd();
chdir (strtolower($cwd));
print "<br>" . getcwd();
print "<br>" . realpath(getcwd());
chdir (strtoupper($cwd));
print "<br>" . getcwd();
print "<br>" . realpath(getcwd());
?>
</body></html>
On my system the first 2 directories show in lower case,
the last two are in caps.
Csaba
------------------------------------------------------------------------
[2002-06-18 18:20:36] csaba at alum dot mit dot edu
realpath and getcwd on Windows systems do not actually report the
applicable directory, but rather a string that will !strcasecmp() with
the true directory:
I have a directory name, $dir, on my Win2K system (PHP 4.2.0), but it's
in all lower case, and I'd like to get the actual pathname including the
capitalizations:
Both realpath() and dirname() only muck around with the $dir string and
don't hit the file system. Not only that, but getcwd() returns $dir
(sans capitalizations) after I've hopped over to it with chdir($dir)!
My only solution to this point is to pop up a level and use
readdir(...) but this is wasteful, only giving me one level at a time.
Isn't there a REAL realpath() for windows?
Thanks,
Csaba Gabor
------------------------------------------------------------------------
--
Edit this bug report at [url]http://bugs.php.net/?id=17822&edit=1[/url]
csaba at alum dot mit dot edu Guest
-
Non Ascii pathname
When I try to open a .dcr file that has Japanese characters in the pathname IE seems to find it fine. But the ActiveX control seems to be unable to... -
#40139 [NEW]: Mail command not returning true on success
From: sab2002a at yahoo dot com Operating system: FreeBSD 5.4 PHP version: 4.4.4 PHP Bug Type: Mail related Bug description:... -
nuke: is_admin always returning true
I'm tweaking the Your Account module in Nuke 7.2 and only want to display an add user link to the admin. I added to the end of... -
include not returning true under zend debugger - possible bug?
Hi, if I have a statement like this; $success = @include "somefile.inc"; under normally runnning in win2000 php 4.3.3 $success is true if... -
mysql_query not returning true on innodb
Hi there i have a random issue where mysql_query is not returning true sometimes on an innodb table which will trigger a custom error, this happens...



Reply With Quote

