#20375 [Opn->Fbk]: OpenDir: Invalid argument (errno 22) when setting var to a mappend net drive
ID: 20375
Updated by: iliaa@php.net
Reported By: xenosis2000@hotmail.com
-Status: Open
+Status: Feedback
Bug Type: Directory function related
Operating System: Windows 2000 Adv. Server
PHP Version: 4.2.3
New Comment:
Please try using this CVS snapshot:
http://snaps.php.net/php4-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php4-win32-latest.zip
Previous Comments:
------------------------------------------------------------------------
[2002-11-11 18:21:19] xenosis2000@hotmail.com
It is worth me saying that everthing works fine if I point it to a
local drive and dir on c:
And permissions are ok because I can access the drive from a dos prompt
or windows explorer and read/write files.
------------------------------------------------------------------------
[2002-11-11 18:19:11] xenosis2000@hotmail.com
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 this bug report at http://bugs.php.net/?id=20375&edit=1
Thread (4 messages)