|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2001-01-02 20:01 UTC] sniper@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 30 18:00:02 2025 UTC |
The below script will generate a "permission denied" error when trying to rmdir the specified directory. sleep() does not do any good (in helping me delete the dir), nor does putting the reading of the directory into a function. After I moved the rmdir into a separate script it did not generate an error. It makes no difference whether it's forward or backward slashes in the path. This happens only after using the opendir/readdir/closedir sequence. I have not tested further to see if readdir may be the issue. This is a stock 4.03pl1 php, running as an apache module. My Test script: ------------------------- <?php $dirName = "c:/temp/foo.bar"; function checkDir() { global $dirName; $dirHandle = opendir($dirName); while($fileName = readdir($dirHandle)) { print $fileName."\n"; } closedir($dirHandle); } print "Making directory\n"; mkdir($dirName, 0777); checkDir(); print "Removing directory\n"; rmdir($dirName); ?> --------------------------------------------