#41063 [NEW]: chdir doesn't like root paths.
| From: | RQuadling at GMail dot com | Date: | Thu, 12 Apr 2007 14:19:12 +0000 |
| Subject: | #41063 [NEW]: chdir doesn't like root paths. | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-111406@lists.php.net to get a copy of this message | ||
From: RQuadling at GMail dot com
Operating system: Windows XP SP2
PHP version: 5CVS-2007-04-12 (snap)
PHP Bug Type: Directory function related
Bug description: chdir doesn't like root paths.
Description:
------------
chdir('D:/') doesn't work. It may have (sorry - I've only just noticed the
error log as the script runs unattended).
A proof has been supplied.
Using PHP 5.2.2RC2-dev (cli) (built: Apr 12 2007 04:03:00)
Reproduce code:
---------------
<?php
echo 'Current Directory is ', getcwd(), PHP_EOL;
echo 'Path to script is ', dirname($argv[0]), PHP_EOL;
echo 'Change to path of script : ', (chdir(dirname($argv[0])) ? 'Success'
: 'Failed'), PHP_EOL;
echo 'Current Directory is ', getcwd(), PHP_EOL;
echo 'Root to path to script is ', dirname(dirname($argv[0])), PHP_EOL;
echo 'Change to root of path of script : ',
(chdir(dirname(dirname($argv[0]))) ? 'Success' : 'Failed'), PHP_EOL;
echo 'Current Directory is ', getcwd(), PHP_EOL;
?>
Expected result:
----------------
Current Directory is C:\
Path to script is D:\PHP Quickies
Change to path of script : Success
Current Directory is D:\PHP Quickies
Root to path to script is D:\
Change to root of path of script : Success
Current Directory is D:\
Actual result:
--------------
Current Directory is C:\
Path to script is D:\PHP Quickies
Change to path of script : Success
Current Directory is D:\PHP Quickies
Root to path to script is D:\
Change to root of path of script :
Warning: chdir(): No such file or directory (errno 2) in D:\PHP
Quickies\chdir_test.php on line 7
Failed
Current Directory is D:\PHP Quickies
--
Edit bug report at http://bugs.php.net/?id=41063&edit=1
--
Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=41063&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=41063&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=41063&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=41063&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=41063&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=41063&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=41063&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=41063&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=41063&r=support
Expected behavior: http://bugs.php.net/fix.php?id=41063&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=41063&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=41063&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=41063&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=41063&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=41063&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=41063&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=41063&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=41063&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=41063&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=41063&r=mysqlcfg