From:             [EMAIL PROTECTED]
Operating system: Windows 2000 Adv. Server
PHP version:      4.2.3
PHP Bug Type:     Directory function related
Bug description:  OpenDir: Invalid argument (errno 22) when setting var to a mappend 
net drive

Just a side note: I have tried setting $logpath to a number of different
options with no success.
s:\UT2003Server\System\
s:\\UT2003Server\\System\\
s:\UT2003~2\System\
s:\UT2003~2\System
s:\\UT2003~2\\System\\
s:\\UT2003~2\\System
s:/UT2003~2/System/
s://UT2003~2//System//
s:/UT2003~2/System

The url i access is: http://myweb.com/localstats/utlogs.php?pass=mypass

Here is the relavent code to what I am running:

filename: config.inc.php
<?php

require("./utstatsdb.inc.php");
$logpath = "s:\\UT2003~2\\System\\";
$title_msg = "Unreal Tournament 2003 LocalStats Server";

?>


filename: utlogs.php
<?php

/*
    UT2003 StatsDB
    Copyright (C) 2002  Paul Gallier

    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 
USA
*/

require("config.inc.php");
require("utlogsql.php");

$magic = get_magic_quotes_gpc();
if ($magic) {
  $password = stripslashes($_GET["pass"]);
  $save = stripslashes($_GET["savelogs"]);
}
else {
  $password = $_GET["pass"];
  $save = $_GET["savelogs"];
}

if ($password == "" || $AdminPass == "" || $password != $AdminPass) {
  echo "Access error.<br>";
  exit;
}

require("utlogparse.php");
require("utlogsave.php");

$files = 0;
$logs_saved = 0;
$handle=opendir($logpath);
while (($file = readdir($handle)) != false) {
  if (strstr($file, "LocalStats_") && substr($file, -4) == ".txt") { //
LocalStats format
    $tok = strtok($file, "_"); // 'LocalStats'
    if ($tok != "") {
      $tok = strtok("_"); // <port>
    if ($tok != "") {
      $tok = strtok("_"); // <year>
      $fd_year = (int) $tok;
    if ($tok != "") {
      $tok = strtok("_"); // <month>
      $fd_month = (int) $tok;
    if ($tok != "") {
      $tok = strtok("_"); // <day>
      $fd_day = (int) $tok;
    if ($tok != "") {
      $tok = strtok("_"); // <hour>
      $fd_hour = (int) $tok;
    if ($tok != "") {
      $tok = strtok("_"); // <min>
      $fd_min = (int) $tok;
    if ($tok != "") {
      $tok = strtok("."); // <sec>
      $fd_sec = (int) $tok;
      $fdate = sprintf("%04u-%02u-%02u %02u:%02u:%02u", $fd_year,
$fd_month, $fd_day,
                        $fd_hour, $fd_min, $fd_sec); // 2001-12-08
18:52:15
      $logs[$files] = $file;
      $logdate[$files++] = $fdate;
    }}}}}}}
  }
  else if (strlen($file) >= 18 && strlen($file) <= 23 && substr($file, -4)
== ".txt") { // MutLocalLog format
    $tok = strtok($file, "-"); // <year>
    $fd_year = (int) $tok;
    if ($tok != "") {
      $tok = strtok("-"); // <month>
      $fd_month = (int) $tok;
    if ($tok != "") {
      $tok = strtok("-"); // <day>
      $fd_day = (int) $tok;
    if ($tok != "") {
      $tok = strtok("-"); // <hour>
      $fd_hour = (int) $tok;
    if ($tok != "") {
      $tok = strtok("-"); // <min>
      $fd_min = (int) $tok;
    if ($tok != "") {
      $tok = strtok("."); // <sec>
      $fd_sec = (int) $tok;
      $fdate = sprintf("%04u-%02u-%02u %02u:%02u:%02u", $fd_year,
$fd_month, $fd_day,
                        $fd_hour, $fd_min, $fd_sec); // 2001-12-08
18:52:15
      $logs[$files] = $file;
      $logdate[$files++] = $fdate;
    }}}}}
  }
}
closedir($handle); 
array_multisort($logdate, $logs, SORT_NUMERIC, SORT_ASC);

for ($i = 0; $i < $files; $i++) {
  echo "Processing log '$logs[$i]'....";
  $file = $logpath."/".$logs[$i];
  $logfile = file($file);
  if (parselog($logfile) == 1) {
    if (storedata())
      echo "game $gamenum successfully processed.<br>\n";
    else
      echo "not processed.<br>\n";
    $logs_saved++;
    if (!$save)
      unlink($file);
  } else {
    if ($i < $files - 1) {
      echo "incomplete.<br>\n";
      if (!$save)
        unlink($file);
    }
    else {
      echo "incomplete (in session?).<br>\n";
    }
  }
//  flush(); *tag*
}

if (!$files)
  echo "<br>No log files to process.<br>\n";
else {
  echo "<br>$logs_saved of $files logs processed.<br>\n";
  // Check career highs for each user
  echo "<br>Calculating Career Highs....";
  require("utcalchighs.php");
  echo "Finished.<br>\n";
}

?>





Here is the errors:

Warning: OpenDir: Invalid argument (errno 22) in
c:\inetpub\wwwroot\localstats\utlogs.php on line 45

Warning: readdir(): supplied argument is not a valid Directory resource in
c:\inetpub\wwwroot\localstats\utlogs.php on line 46

Warning: closedir(): supplied argument is not a valid Directory resource
in c:\inetpub\wwwroot\localstats\utlogs.php on line 100

Warning: Argument 1 to array_multisort() is expected to be an array or a
sort flag in c:\inetpub\wwwroot\localstats\utlogs.php on line 101

No log files to process.


-- 
Edit bug report at http://bugs.php.net/?id=20375&edit=1
-- 
Try a CVS snapshot:         http://bugs.php.net/fix.php?id=20375&r=trysnapshot
Fixed in CVS:               http://bugs.php.net/fix.php?id=20375&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=20375&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=20375&r=needtrace
Try newer version:          http://bugs.php.net/fix.php?id=20375&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=20375&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=20375&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=20375&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=20375&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=20375&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=20375&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=20375&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=20375&r=isapi

Reply via email to