|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2003-07-24 11:44 UTC] wez@php.net
[2003-07-26 11:27 UTC] jf dot klug at canfer dot com
[2003-07-26 18:14 UTC] iliaa@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Nov 07 16:00:02 2025 UTC |
Description: ------------ I'm trying to open a directory that is on a win2k network share. I've read about UNC path problems, and they all claim to have been fixed in 4.0.6 or somthing like that, but i'm using 4.3.2 and it's still not working. This code was ripped straight form the php documentation: <?php $dir = "/tmp/"; // Open a known directory, and proceed to read its contents if (is_dir($dir)) { if ($dh = opendir($dir)) { while (($file = readdir($dh)) !== false) { print "filename: $file : filetype: " . filetype($dir . $file) . "<br>"; } closedir($dh); } } ?> Now when I make $dir equal to "//shareddrive/" or "\\\\shareddrive\\" nothing happens, no error or anything. Same thing happens if I map the drive to a letter, like "z:", it still does nothing. It doesn't list the directory, nor does it give an error. The server has full rights to connect with the shared folder, so it's not a permissions thing. It also doesn't work when I use the UNC path for the webserver that this script is running on, but it does work when I just list "./" so I think it's just a problem with UNC paths. The server is running IIS 5.0 and php 4.3.2. Yes there are other UNC path bug reports, but they've all been dissmissed and stated that it's fixed in 4.0.6, but I'm using a way later version then that and it's not fixed, so what gives? Reproduce code: --------------- <?php $dir = "//fileserv/"; // Open a known directory, and proceed to read its contents if (is_dir($dir)) { if ($dh = opendir($dir)) { while (($file = readdir($dh)) !== false) { print "filename: $file : filetype: " . filetype($dir . $file) . "<br>"; } closedir($dh); } } ?> Expected result: ---------------- Should list all files and folders in that directory. Actual result: -------------- A blank page. No error or nothing.