ID:               41063
 Updated by:       [EMAIL PROTECTED]
 Reported By:      RQuadling at GMail dot com
-Status:           Assigned
+Status:           Closed
 Bug Type:         Directory function related
 Operating System: Windows XP SP2
 PHP Version:      5CVS-2007-04-12 (snap)
 Assigned To:      dmitry
 New Comment:

Fixed in CVS HEAD and PHP_5_2.


Previous Comments:
------------------------------------------------------------------------

[2007-04-12 14:19:12] RQuadling at GMail dot com

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 this bug report at http://bugs.php.net/?id=41063&edit=1

Reply via email to