dir functions, Apache 1.3 and win98
| From: | Ulf Tornert | Date: | Sat, 11 Nov 2000 22:42:25 +0000 |
| Subject: | dir functions, Apache 1.3 and win98 | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-24811@lists.php.net to get a copy of this message | ||
Hi,
I'm having trouble with the dir functions. It's really annoying and I
can't figure out what's wrong. Check code below:
<?php
echo("This directory contains the following files and
directories:<BR>");
$thisdir = opendir(".");
while ($file = readdir($thisdir)){
echo($file . "<BR>"); // prints every entry in current dir.
}
$newDir = chdir("/temp");
echo( ($newDir? "Succeeded!": "chdir() not made.") . "<BR>");
echo("This directory contains the following files and
directories:<BR>");
$thisdir = opendir(".");
while ($file = readdir($thisdir)){
echo($file . "<BR>"); // prints every entry in the WRONG directory...
}
?>
I get the message "Succeeded" - meaning that PHP did change the current
directory, but when I list the entries in it the result is precisely the
same as before! Has anyone else had problems with the chdir()-function,
running on a win98 machine? (Apache 1.3)
Uffe