#48746 [Fbk]: Unable to browse directories within Junction Points
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: Please try using: http://windows.php.net/downloads/qa/test/php-5.3.2-dev-Win32-VC9-x86.zip It is a striped down build (thread safe). Only CLI is available but no worry, it behaves the same than apache in TS mode. Previous Comments: [2009-09-04 20:59:28] phpstuff at cresstone dot com Using junctions: is_file and file_exists are giving incorrect behavior (false on files). is_dir as well, false on directories in the junction and the junction itself. The same functions are working well with symlinks. If you need testing for this, you have mail. [2009-09-04 20:45:25] paj...@php.net @[4 Sep 8:20pm UTC] phpstuff at cresstone dot com Using is_dir and is_file or file_exists and the cases you described, does it work? (I don't think the filetype issue is related to what we discuss here). [2009-09-04 20:20:02] phpstuff at cresstone dot com I was able replicate shoresofnowhere's behavior using windows 7... I created a junction to a folder on another drive; running is_file() on a file inside that junction returned false, as did is_dir(). Curious to see what php thought it was looking at, I tested filetype(), which threw an error. I then tested symlinks in the same manner, and got good behavior. Symlinks seem to be a good workaround for this issue. Test log follows: C:\mnt\test>mklink /J junction_otherDrive f:\downloads Junction created for junction_otherDrive <<===>> f:\downloads C:\mnt\test>mklink /D symlink_otherDrive f:\downloads symbolic link created for symlink_otherDrive <<===>> f:\downloads C:\mnt\test>dir Volume in drive C is coreI7_System Volume Serial Number is 38E2-2B62 Directory of C:\mnt\test 2009.09.04 16.05 . 2009.09.04 16.05 .. 2009.09.04 16.05 junction_otherDrive [f:\downloads] 2009.09.04 16.05 symlink_otherDrive [f:\downloads] 0 File(s) 0 bytes 4 Dir(s) 30,034,223,104 bytes free C:\mnt\test>php -r var_dump(filetype('junction_otherdrive')); PHP Warning: filetype(): Lstat failed for junction_otherdrive in Command line code on line 1 Warning: filetype(): Lstat failed for junction_otherdrive in Command line code on line 1 bool(false) C:\mnt\test>php -r var_dump(filetype('junction_otherdrive\php-5.2.0-win32-installer.msi')); PHP Warning: filetype(): Lstat failed for junction_otherdrive\php-5.2.0-win32-installer.msi in Comm and line code on line 1 Warning: filetype(): Lstat failed for junction_otherdrive\php-5.2.0-win32-installer.msi in Command l ine code on line 1 bool(false) C:\mnt\test>php -r var_dump(filetype('symlink_otherdrive')); string(3) "dir" C:\mnt\test>php -r var_dump(filetype('symlink_otherdrive\php-5.2.0-win32-installer.msi')); string(4) "file" [2009-09-04 18:32:33] paj...@php.net Ignore my last two comments, it works perfectly using what you describe. I was testing it from another VM where this junction did not exist. I added a include 'dir3/two.php' to one.php, two.php being a simple echo "two.php" The output: C:\test>\php53\debug_ts\php.exe -n one.php two.php bool(true) C:\test>junction dir3 C:\test\dir3: JUNCTION Substitute Name: e:\test C:\test>dir dir3 ... 09/04/2009 07:33 PM24 two.php 1 File(s) 24 bytes 2 Dir(s) 202,975,232 bytes free [2009-09-04 17:50:34] paj...@php.net Please note that it is again a XP/2k3 only issue. Debugging/fixing now. 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
#48746 [Fbk]: Unable to browse directories within Junction Points
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: Please note that it is again a XP/2k3 only issue. Debugging/fixing now. Previous Comments: [2009-09-04 17:36:30] paj...@php.net @shoresofnowhere at gmail dot com ok, I can reproduce it now. I will come back as soon as I have a fix. [2009-09-04 17:26:49] paj...@php.net @shoresofnowhere at gmail dot com I suppose you mean: c:\Dir |_ one.php |_ Dir3 (junction to d:\dir) |_ two.php Using this constellation, here is my output on xp SP3: C:\mnt>junction dir3 Junction v1.05 - .. ... C:\mnt\dir3: JUNCTION Substitute Name: c:\test C:\mnt>\test\php53vc6ts\php.exe one.php bool(true) Are you sure: - apache has been restarted after the update? - the right version is used? Can you try in CLI as well please? [2009-09-04 11:44:08] shoresofnowhere at gmail dot com Sorry but the latest snapshot still has problems: Dir directory one.php file in dir directory Dir2 junction in dir to dir3 on another drive two.php file in dir3 in one.php: is_file(./dir2/two.php) returns FALSE! Working on XP SP3 under Apache 2.2.13 [2009-09-04 08:11:06] mats dot lindh at gmail dot com Everything seems to work OK with a build from 2009-09-03. Thanks for fixing the issue! [2009-09-03 10:10:14] phpstuff at cresstone dot com I'm getting good test behavior from the that snapshot. More tellingly, the original script I've been trying to run is now working correctly. Thanks. 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
#48746 [Fbk]: Unable to browse directories within Junction Points
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: @[4 Sep 8:20pm UTC] phpstuff at cresstone dot com Using is_dir and is_file or file_exists and the cases you described, does it work? (I don't think the filetype issue is related to what we discuss here). Previous Comments: [2009-09-04 20:20:02] phpstuff at cresstone dot com I was able replicate shoresofnowhere's behavior using windows 7... I created a junction to a folder on another drive; running is_file() on a file inside that junction returned false, as did is_dir(). Curious to see what php thought it was looking at, I tested filetype(), which threw an error. I then tested symlinks in the same manner, and got good behavior. Symlinks seem to be a good workaround for this issue. Test log follows: C:\mnt\test>mklink /J junction_otherDrive f:\downloads Junction created for junction_otherDrive <<===>> f:\downloads C:\mnt\test>mklink /D symlink_otherDrive f:\downloads symbolic link created for symlink_otherDrive <<===>> f:\downloads C:\mnt\test>dir Volume in drive C is coreI7_System Volume Serial Number is 38E2-2B62 Directory of C:\mnt\test 2009.09.04 16.05 . 2009.09.04 16.05 .. 2009.09.04 16.05 junction_otherDrive [f:\downloads] 2009.09.04 16.05 symlink_otherDrive [f:\downloads] 0 File(s) 0 bytes 4 Dir(s) 30,034,223,104 bytes free C:\mnt\test>php -r var_dump(filetype('junction_otherdrive')); PHP Warning: filetype(): Lstat failed for junction_otherdrive in Command line code on line 1 Warning: filetype(): Lstat failed for junction_otherdrive in Command line code on line 1 bool(false) C:\mnt\test>php -r var_dump(filetype('junction_otherdrive\php-5.2.0-win32-installer.msi')); PHP Warning: filetype(): Lstat failed for junction_otherdrive\php-5.2.0-win32-installer.msi in Comm and line code on line 1 Warning: filetype(): Lstat failed for junction_otherdrive\php-5.2.0-win32-installer.msi in Command l ine code on line 1 bool(false) C:\mnt\test>php -r var_dump(filetype('symlink_otherdrive')); string(3) "dir" C:\mnt\test>php -r var_dump(filetype('symlink_otherdrive\php-5.2.0-win32-installer.msi')); string(4) "file" [2009-09-04 18:32:33] paj...@php.net Ignore my last two comments, it works perfectly using what you describe. I was testing it from another VM where this junction did not exist. I added a include 'dir3/two.php' to one.php, two.php being a simple echo "two.php" The output: C:\test>\php53\debug_ts\php.exe -n one.php two.php bool(true) C:\test>junction dir3 C:\test\dir3: JUNCTION Substitute Name: e:\test C:\test>dir dir3 ... 09/04/2009 07:33 PM24 two.php 1 File(s) 24 bytes 2 Dir(s) 202,975,232 bytes free [2009-09-04 17:50:34] paj...@php.net Please note that it is again a XP/2k3 only issue. Debugging/fixing now. [2009-09-04 17:36:30] paj...@php.net @shoresofnowhere at gmail dot com ok, I can reproduce it now. I will come back as soon as I have a fix. [2009-09-04 17:26:49] paj...@php.net @shoresofnowhere at gmail dot com I suppose you mean: c:\Dir |_ one.php |_ Dir3 (junction to d:\dir) |_ two.php Using this constellation, here is my output on xp SP3: C:\mnt>junction dir3 Junction v1.05 - .. ... C:\mnt\dir3: JUNCTION Substitute Name: c:\test C:\mnt>\test\php53vc6ts\php.exe one.php bool(true) Are you sure: - apache has been restarted after the update? - the right version is used? Can you try in CLI as well please? 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
#48746 [Fbk]: Unable to browse directories within Junction Points
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: Ignore my last two comments, it works perfectly using what you describe. I was testing it from another VM where this junction did not exist. I added a include 'dir3/two.php' to one.php, two.php being a simple echo "two.php" The output: C:\test>\php53\debug_ts\php.exe -n one.php two.php bool(true) C:\test>junction dir3 C:\test\dir3: JUNCTION Substitute Name: e:\test C:\test>dir dir3 ... 09/04/2009 07:33 PM24 two.php 1 File(s) 24 bytes 2 Dir(s) 202,975,232 bytes free Previous Comments: [2009-09-04 17:50:34] paj...@php.net Please note that it is again a XP/2k3 only issue. Debugging/fixing now. [2009-09-04 17:36:30] paj...@php.net @shoresofnowhere at gmail dot com ok, I can reproduce it now. I will come back as soon as I have a fix. [2009-09-04 17:26:49] paj...@php.net @shoresofnowhere at gmail dot com I suppose you mean: c:\Dir |_ one.php |_ Dir3 (junction to d:\dir) |_ two.php Using this constellation, here is my output on xp SP3: C:\mnt>junction dir3 Junction v1.05 - .. ... C:\mnt\dir3: JUNCTION Substitute Name: c:\test C:\mnt>\test\php53vc6ts\php.exe one.php bool(true) Are you sure: - apache has been restarted after the update? - the right version is used? Can you try in CLI as well please? [2009-09-04 11:44:08] shoresofnowhere at gmail dot com Sorry but the latest snapshot still has problems: Dir directory one.php file in dir directory Dir2 junction in dir to dir3 on another drive two.php file in dir3 in one.php: is_file(./dir2/two.php) returns FALSE! Working on XP SP3 under Apache 2.2.13 [2009-09-04 08:11:06] mats dot lindh at gmail dot com Everything seems to work OK with a build from 2009-09-03. Thanks for fixing the issue! 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
#48746 [Fbk]: Unable to browse directories within Junction Points
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: @shoresofnowhere at gmail dot com ok, I can reproduce it now. I will come back as soon as I have a fix. Previous Comments: [2009-09-04 17:26:49] paj...@php.net @shoresofnowhere at gmail dot com I suppose you mean: c:\Dir |_ one.php |_ Dir3 (junction to d:\dir) |_ two.php Using this constellation, here is my output on xp SP3: C:\mnt>junction dir3 Junction v1.05 - .. ... C:\mnt\dir3: JUNCTION Substitute Name: c:\test C:\mnt>\test\php53vc6ts\php.exe one.php bool(true) Are you sure: - apache has been restarted after the update? - the right version is used? Can you try in CLI as well please? [2009-09-04 11:44:08] shoresofnowhere at gmail dot com Sorry but the latest snapshot still has problems: Dir directory one.php file in dir directory Dir2 junction in dir to dir3 on another drive two.php file in dir3 in one.php: is_file(./dir2/two.php) returns FALSE! Working on XP SP3 under Apache 2.2.13 [2009-09-04 08:11:06] mats dot lindh at gmail dot com Everything seems to work OK with a build from 2009-09-03. Thanks for fixing the issue! [2009-09-03 10:10:14] phpstuff at cresstone dot com I'm getting good test behavior from the that snapshot. More tellingly, the original script I've been trying to run is now working correctly. Thanks. [2009-09-02 23:26:04] paj...@php.net I can't reproduce the problem with is_dir or is_file behave correctly, however I think I found the problem and commited a fix. I can reproduce the scandir one, same fix. I manually launched a build, you can get the vc9-x86 here: http://is.gd/2OtDf (other snaps should be online within 15mins). 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
#48746 [Fbk]: Unable to browse directories within Junction Points
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: @shoresofnowhere at gmail dot com I suppose you mean: c:\Dir |_ one.php |_ Dir3 (junction to d:\dir) |_ two.php Using this constellation, here is my output on xp SP3: C:\mnt>junction dir3 Junction v1.05 - .. ... C:\mnt\dir3: JUNCTION Substitute Name: c:\test C:\mnt>\test\php53vc6ts\php.exe one.php bool(true) Are you sure: - apache has been restarted after the update? - the right version is used? Can you try in CLI as well please? Previous Comments: [2009-09-04 11:44:08] shoresofnowhere at gmail dot com Sorry but the latest snapshot still has problems: Dir directory one.php file in dir directory Dir2 junction in dir to dir3 on another drive two.php file in dir3 in one.php: is_file(./dir2/two.php) returns FALSE! Working on XP SP3 under Apache 2.2.13 [2009-09-04 08:11:06] mats dot lindh at gmail dot com Everything seems to work OK with a build from 2009-09-03. Thanks for fixing the issue! [2009-09-03 10:10:14] phpstuff at cresstone dot com I'm getting good test behavior from the that snapshot. More tellingly, the original script I've been trying to run is now working correctly. Thanks. [2009-09-02 23:26:04] paj...@php.net I can't reproduce the problem with is_dir or is_file behave correctly, however I think I found the problem and commited a fix. I can reproduce the scandir one, same fix. I manually launched a build, you can get the vc9-x86 here: http://is.gd/2OtDf (other snaps should be online within 15mins). [2009-09-02 22:59:59] s...@php.net Automatic comment from SVN on behalf of pajoye Revision: http://svn.php.net/viewvc/?view=revision&revision=287975 Log: - #48746, len includes null already 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
#48746 [Fbk]: Unable to browse directories within Junction Points
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: I can't reproduce the problem with is_dir or is_file behave correctly, however I think I found the problem and commited a fix. I can reproduce the scandir one, same fix. I manually launched a build, you can get the vc9-x86 here: http://is.gd/2OtDf (other snaps should be online within 15mins). Previous Comments: [2009-09-02 22:59:59] s...@php.net Automatic comment from SVN on behalf of pajoye Revision: http://svn.php.net/viewvc/?view=revision&revision=287975 Log: - #48746, len includes null already [2009-09-02 21:29:08] phpstuff at cresstone dot com Using Windows 7 x64. It seems all files in my mounted volumes are being treated as directories. (is_dir returns true, is_file returns false.) Directory operations pointed at files seem to point back to the root of the volume. The following script: echo "dumping: scandir('mounted_volume')\n"; var_dump(scandir('mounted_volume')); echo "dumping: scandir('mounted_volume\\file1')\n"; var_dump(scandir('mounted_volume\file1')); gives this output: dumping: scandir('mounted_volume') array(4) { [0]=> string(12) "$RECYCLE.BIN" [1]=> string(4) "dir1" [2]=> string(4) "dir2" [3]=> string(5) "file1" } dumping: scandir('mounted_volume\file1') array(4) { [0]=> string(12) "$RECYCLE.BIN" [1]=> string(4) "dir1" [2]=> string(4) "dir2" [3]=> string(5) "file1" } Nesting does not seem to matter, eg: scandir('mounted_volume\dir1\file_in_dir1'); gives the same output Something else that's interesting... When I create the junction from a drive letter, eg: "mklink mounted_volume y:" everything works perfectly, files are files and dirs are dirs. It's only when I use the volume name in the creation ("mklink /J mounted_volume \\?\Volume{feeac7c1-2ad0-11de-89bb-001fd0ae05ac}\") that I get this strange behavior. Bizarre, but I swear I'm not making this up :) [2009-09-02 10:35:32] paj...@php.net Can't reproduce here. Which OS are you using for this test? [2009-09-02 10:30:20] paj...@php.net Oh my, I'm about to loose my last hair :) But we are getting close now... back to code [2009-09-02 10:12:22] phpstuff at cresstone dot com sorry, found another mounted volume issue: is_dir reutrns true when passed a file on a mounted volume. Additionaly, chdir retruns true when passed that file. eg: is_dir('c:\mounted_volume\image.jpg'); returns true. image.jpg is a file and mounted_volume is a junction point mounted volume. 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
#48746 [Fbk]: Unable to browse directories within Junction Points
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: scandir has been fixed (not directly related to this issue) as well as the mounted points issues. All regressions should be fixed now. Can you give it a try please? The next snapshot will have the fixes. Previous Comments: [2009-09-01 17:51:00] s...@php.net Automatic comment from SVN on behalf of pajoye Revision: http://svn.php.net/viewvc/?view=revision&revision=287950 Log: - #48746, revert previous about volume. Fix volume support to allow all mounted points (with or without drives) [2009-09-01 17:46:17] s...@php.net Automatic comment from SVN on behalf of pajoye Revision: http://svn.php.net/viewvc/?view=revision&revision=287949 Log: - #48746, fix regression in readdir/scandir and mounted points or junctions on windows [2009-08-30 13:06:33] paj...@php.net @shoresofnowhere at gmail dot com Not with symlink/link/etc. You can try it under unix as well: /var/www/dir1 /var/www/test.txt /var/www/dir2 /var/www/dir2/linktodir1 /var/www/dir2/test2.txt /var/www/dir2/linktodir1/t.php In t.php, ../test2.txt will fail because it will use dir1 as base direct. That's how it always worked, windows had only partial support for links (symbolic or hard) or junctions. It worked before but it was not correct (and not portable). [2009-08-30 13:00:44] shoresofnowhere at gmail dot com @ pajoye: Sorry, but i don't understand why the correct behaviour should be that of 5.3: dir1 directory subdir1 subdirectory of dir1 cfg.php file in dir1 dir2 directory cfg.php file in dir2 junction1 junction to subdir1 created in dir2 and i have in dir1/subdir1/file.php: require_once("../cfg.php"); I expect that if i run dir1/subdir1/file.php i get require_once("dir1/cfg.php"); BUT if i run dir2/subdir1/file.php i will get require_once("dir2/cfg.php"); Could you please tell me why this would be wrong? File inclusions have always been relative to the path of the main php file that's executing... Thanks! [2009-08-30 11:17:07] paj...@php.net 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. 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
#48746 [Fbk]: Unable to browse directories within Junction Points
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: @shoresofnowhere at gmail dot com Not with symlink/link/etc. You can try it under unix as well: /var/www/dir1 /var/www/test.txt /var/www/dir2 /var/www/dir2/linktodir1 /var/www/dir2/test2.txt /var/www/dir2/linktodir1/t.php In t.php, ../test2.txt will fail because it will use dir1 as base direct. That's how it always worked, windows had only partial support for links (symbolic or hard) or junctions. It worked before but it was not correct (and not portable). Previous Comments: [2009-08-30 13:00:44] shoresofnowhere at gmail dot com @ pajoye: Sorry, but i don't understand why the correct behaviour should be that of 5.3: dir1 directory subdir1 subdirectory of dir1 cfg.php file in dir1 dir2 directory cfg.php file in dir2 junction1 junction to subdir1 created in dir2 and i have in dir1/subdir1/file.php: require_once("../cfg.php"); I expect that if i run dir1/subdir1/file.php i get require_once("dir1/cfg.php"); BUT if i run dir2/subdir1/file.php i will get require_once("dir2/cfg.php"); Could you please tell me why this would be wrong? File inclusions have always been relative to the path of the main php file that's executing... Thanks! [2009-08-30 11:17:07] paj...@php.net 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. [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. 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
#48746 [Fbk]: Unable to browse directories within Junction Points
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
#48746 [Fbk]: Unable to browse directories within Junction Points
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: 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? Previous Comments: [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. [2009-08-29 12:23:01] paj...@php.net Thanks for the testing! :) Added support for mounted volumes (and path resolutions for them). The next snapshots (5.3+) should have it. 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
#48746 [Fbk]: Unable to browse directories within Junction Points
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: @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). Previous Comments: [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. [2009-08-29 12:23:01] paj...@php.net Thanks for the testing! :) Added support for mounted volumes (and path resolutions for them). The next snapshots (5.3+) should have it. [2009-08-29 12:21:48] s...@php.net Automatic comment from SVN on behalf of pajoye Revision: http://svn.php.net/viewvc/?view=revision&revision=287877 Log: - Fix #48746, mounted volume support & resolution [2009-08-27 19:37:08] phpstuff at cresstone dot com Ok, this snap seems to get everything except mounted volumes for me. test output is now: C:\mnt\test>php phptest.php directory: bool(true) junction.exe junction: bool(true) mklink junction:bool(true) mounted volume: bool(false) I've found 3 ways to create volume junction points on Win 7: Through the mountvol command, thourgh the mklink command, and though the diskmgmt.msc GUI. They all result in the same behavior. I also just found that mklink can create symlinks to volumes, which, alas, also fail. (symlinks to directories & files work fine) 'dir' command for symlinks vs. junctions to volumes looks like this: 2009.08.27 15.18 test2 [\\?\Volume{c7981ed5-d602-11dd-ac24-806e6f6e6963}\] 2009.08.27 15.19 test3 [\\?\Volume{c7981ed5-d602-11dd-ac24-806e6f6e6963}\] For the record, the following command sequence can be used to re-create my test setup... c:\mnt & c:\mnt\test are regular directories. C:\mnt\test>mkdir directory C:\mnt\test>junction junction directory Junction v1.05 - Windows junction creator and reparse point viewer Copyright (C) 2000-2007 Mark Russinovich Systems Internals - http://www.sysinternals.com Created: C:\mnt\test\junction Targetted at: C:\mnt\test\directory C:\mnt\test>mklink /j mklink_junction directory Junction created for mklink_junction <<===>> directory C:\mnt\test>mklink /j mounted_volume \\?\Volume{c7981ed5-d602-11dd-ac24-806e6f6e6963}\ Junction created for mounted_volume <<===>> \\?\Volume{c7981ed5-d602-11dd-ac24-806e6f6e6963}\ C:\mnt\test>dir Volume in drive C is coreI7_System Volume Serial Number is 38E2-2B62 Directory of C:\mnt\test 2009.08.27 15.29 . 2009.08.27 15.29 .. 2009.08.27 15.27 directory 2009.08.27 15.27 junction [\??\C:\mnt\test\directory] 2009.08.27 15.28 mklink_junction [C:\mnt\test\directory] 2009.08.27 15.29 mounted_volume [\\?\Volume{c7981ed5-d602-11dd-ac24-806e6f6e6963} \] 2009.08.27 15.23 451 phptest.php 1 File(s)451 bytes 6 Dir(s) 28,746,731,520 bytes free C:\mnt\test>php phptest.php directory: bool(true) junction.exe junction: bool(true) mklink junction:bool(true) mounted volume: bool(false) Thanks for your work on this, unfortunately, my inability to keep track of drive letters means I use a lot of mounted volumes... [2009-08-27 09:50:22] paj...@php.net And confirmed your last cases using Win7/Vista/2k8. In this case junction are prepended with \??\. Fix applied, the next snap should have it. 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
#48746 [Fbk]: Unable to browse directories within Junction Points
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: Did you mount another drive in c:\mnt? Previous Comments: [2009-08-11 05:39:54] paj...@php.net Sorry but I can't reproduce it on vista/win7/2k8 but only on 2k3 and xp. How exactly did you create the junctions on these platforms? It looks like you create a junction to the root of another drive, right? [2009-08-10 22:30:09] phpstuff at cresstone dot com For what it's worth, I've reproduced the incorrect behavior on the following OSes so far: Windows 7 x64 Vista x64 SP2 Server 2003 x64 SP2 XP SP2 For other readers, these are the submitted issues I've found that may be related to this bug: http://bugs.php.net/bug.php?id=48778 http://bugs.php.net/bug.php?id=48746 http://bugs.php.net/bug.php?id=48975 http://bugs.php.net/bug.php?id=49039 [2009-08-10 21:41:37] paj...@php.net and confirmed using XP SP3 as well. For the record, get the junction command here: http://technet.microsoft.com/en-us/sysinternals/bb896768.aspx [2009-08-10 20:23:35] paj...@php.net Ok, seems to be 2k3 specific. The same setup works on 2k8/vista/win7. Thanks for your feedback! [2009-08-10 20:17:32] phpstuff at cresstone dot com cgi executable does not seem to make a difference. This is a console log of a test I just ran: C:\mnt\test>type phptest.php C:\mnt\test>dir Volume in drive C is coreI7_System Volume Serial Number is 38E2-2B62 Directory of C:\mnt\test 2009.08.10 16.11 . 2009.08.10 16.11 .. 2009.08.10 16.10 directory 2009.08.10 16.10 junction [\??\Volume{e13ba66a-14db-11de-8e96-001fd0ae05ac}\] 2009.08.10 16.1182 phptest.php 1 File(s) 82 bytes 4 Dir(s) 24,899,223,552 bytes free C:\mnt\test>php.exe phptest.php bool(false) bool(true) C:\mnt\test>php-cgi.exe phptest.php X-Powered-By: PHP/5.3.0 Content-type: text/html bool(false) bool(true) C:\mnt\test> 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