ID: 48746 Updated by: paj...@php.net Reported By: ddkees at illinois dot edu Status: Feedback Bug Type: Directory function related Operating System: win32 only - Windows Server 2003 PHP Version: 5.3.0 Assigned To: pajoye New Comment:
Found the problems, the windows port of dirent (scandir) as well as php_mkdir (used by mkdir()) lack a call to realpath, making them use the current path with the standard API. It ends to use c:. Testing the patch but it should do it for RC1 next Tuesday. You can test the patch yourself by calling realpath manually: scandir(realpath('mounted_volume')); or mkdir(realpath('mounted_volume\\test34')); Other files operations work as expected. Previous Comments: ------------------------------------------------------------------------ [2009-08-30 10:39:21] paj...@php.net Using different drives work fine here (ie. G, Z or whatever else). Did you test it using CLI? And running each test separately or using one single script with all tests (stat cache will be used in this case)? Which windows version? ------------------------------------------------------------------------ [2009-08-30 04:41:30] phpstuff at cresstone dot com Hmmm. may have spoke too soon. Getting some weird results when working with mounted volumes. 'C:\mnt\test\mounted_volume' is a junction mounted volume that is *not* the system drive ie: not c:\ Take the following sequence of commands, working directory is 'C:\mnt\test\': is_dir('mounted_volume'); Returns true, yay! scandir('mounted_volume'); Here's the strange behavior; this command enumerates the root system drive, c:\, rather than the correct pointed-to volume. mkdir('mounted_volume\test34'); Returns true, but test32 is created on the incorrect volume: c:\test32 now exists is_dir('mounted_volume\test34'); Returns FALSE, this is the correct behavior because the directory does not exist in the correct location, but it is obviously inconsistent with the above mkdir unlink('mounted_volume\test34'); Throws a 'No such file or directory' warning. Appears to be looking in the correct place. My previous tests all used c:\ as the 'mounted volume' which is why I didn't see this at first. ------------------------------------------------------------------------ [2009-08-30 03:30:14] phpstuff at cresstone dot com Latest snapshot give correct behavior for me. Thanks much. ------------------------------------------------------------------------ [2009-08-30 02:09:06] paj...@php.net @shoresofnowhere at gmail dot com It is not correct, the correct behavior is relative to the target of the link/junction, as it is on any other supported platforms with link support. It was not the case in 5.2 but php did not support links correctly (no link at all, and only partially for junction or mounted drive). ------------------------------------------------------------------------ [2009-08-29 20:34:10] shoresofnowhere at gmail dot com Still not working correctly in latest snapshot: now if you have dir1 directory subdir1 subdirectory of dir1 dir2 directory junction1 junction to subdir1 created in dir2 and from a file accessed as dir2/junction1/file.php you reference to the ../ dir, you get to the dir1 directory, while the correct behaviour is to get to dir2! You can see the difference if you try this setup with 5.2.10, which works ok. ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/48746 -- Edit this bug report at http://bugs.php.net/?id=48746&edit=1