Jump to content

Cannot opendir on a DFS path


Strahan

Recommended Posts

Hi.  I have a machine that has content on several drives.  For example, lets say I am referring to E:\Videos\SomeShow.  The machine has a share, \\machine\video2$ that points to E:\Videos.  I have an intranet page that I use for managing and launching my content.  It has a function as such:

function num_files($dir, $onlyvideo = false) {
  global $ArchiveTypes, $VideoTypes;
  $counter = 0;
  if(is_dir($dir)) {
    if (file_exists($dir)) {
      if ($handle = opendir($dir)) {
        while (false !== ($file = readdir($handle))) {
          if ($file != "." && $file != "..") {
            if ($onlyvideo) {
              if (ValidFiles($file, $VideoTypes)) $counter++;
            } else {
              if (ValidFiles($file, $ArchiveTypes)) $counter++;
            }
          }
        }
        closedir($handle);
      }
    }
  }
  return $counter;
}

When that code runs and I pass it "//machine/video2$/someshow", it correctly returns the file count.  Now..  in order to prevent having the annoyance of having to track my video shares across multiple drives and multiple machines, I made a DFS root called "//domain.com/videos".  I have a script that runs daily and manages the DFS links to that root my scanning the folders in each drive share.  Works great.  

 

However..  I have found that if I pass that function "//domain.com/videos/someshow" I get:

 

Warning: opendir(//domain.com/videos/someshow,//domain.com/videos/someshow): Access is denied. (code: 5) in D:\Sites\domain.com\media\RootLibrary.php on line 447

 

I was wondering why it listed the path twice, so just to be sure it was passed correctly I echoed it out just before the opendir and it is correct.  Is there some way around that?  Thanks!

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.