fread() and windows directory permissions
| From: | Benjamin Listwon | Date: | Tue, 08 May 2001 11:30:08 +0000 |
| Subject: | fread() and windows directory permissions | ||
| Groups: | php.windows | ||
| Request: | Send a blank email to php-windows+get-7350@lists.php.net to get a copy of this message | ||
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hello all,
I am trying to read a directory on a Win2K installation of PHP4 and
Apache 1.3. The following is the code I have to read in a directory.
$dirname = "c:/temp";
$dirhandle = fopen($dirname, "r");
$dircontents = fread($dirhandle, filesize($dirname));
fclose($dirhandle);
This seems to work fine under Linux, but when I first tried it under
Windows it gave an error about not having the permissions to read. I
later discovered that I needed the directory to be on an NTFS
partition (POSIX compliant) so I moved it to one. I then applied all
necessary permissions, but the fread() still gets the same error, and
printing the permissions of the directory is the same as it was
before.
I even tried running Apache as a service under the Administrator
logon, which should in theory allow it to do everything I can, but
the problem was still the same.
My question. A) am i going about this all wrong? B) what can be done
to actually read the directory?
Thanks in advance.
- --nettles
-----BEGIN PGP SIGNATURE-----
Version: PGPfreeware 6.5.8 for non-commercial use <http://www.pgp.com>
iQA/AwUBOvfYmdJHHObB9LWkEQJZzwCfTYOmxX6349lg8TTLHUnjS+HQW7QAoNmA
uuqylewvfv52bdG8XAHtuQiU
=LOnd
-----END PGP SIGNATURE-----