Bug #11695: rmdir
| From: | roman dot kytka at centrum dot cz | Date: | Tue, 26 Jun 2001 12:38:06 +0000 |
| Subject: | Bug #11695: rmdir | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-58039@lists.php.net to get a copy of this message | ||
From: roman.kytka@centrum.cz
Operating system: Win 2000
PHP version: 4.0.6
PHP Bug Type: *Directory/Filesystem functions
Bug description: rmdir
Please I don´t know if it is a bug or not, but this script works on my friend´s PC and doesn´t on
mine. I need to delete dirs and files. Files are deleted from dirs correctly but i cannot delete
dirs (older than 2 hours). Please can you help me?
Thanks Roman.
my script:
<?
clearstatcache();
$default_dir = Dir("C:/mydir/");
$tmp=$default_dir->Read();
$tmp=$default_dir->Read();
while($name=$default_dir->Read())
{
$fullname = $default_dir->path . $name;
$isdir = is_dir($fullname);
if ($isdir)
{
$create = FileCTime($fullname);
$act_time = Time();
$time = $create + 7200;
if ($time < $act_time
{
$d = dir($fullname);
while( $entry = $d->read() )
{
if ( $entry != "" && $entry != "."
&& $entry != ".."
{
$fn = $d->path."/".$entry;
unlink( $fn );
}
}
$d->close();
rmdir ($fullname);
}
}
}
$default_dir->close();
?>
And result? Here you are...
<b>Warning</b>: RmDir failed (Permission denied) in
<b>C:\Koruna-zal\pokus.php<
/b> on line <b>38</b><br>
My PC is Win2000(fat32), Apache 1.3.x, PHP 4.0.6.
Dirs are created using mkdir ($dir, 0777);
--
Edit Bug report at: http://bugs.php.net/?id=11695&edit=1