<?php
function copydirs($directname,$tdirectname)
{
if ($dhandle = opendir("$directname/"))
{
while (false !== ($file = readdir($dhandle)))
{
if ($file != "." && $file != "..")
{
echo "$file<br>";
if(is_dir("$file"))
{
mkdir("$tdirectname/$file"); // Since it is windows forget mode
copydirs("$directname/$file","$tdirectname/$file");
}
else
{
copy("$directname/$file","$tdirectname/$file");
echo "<br>$directname/$file<br> $tdirectname/$file";
}
}
}
closedir($dhandle);
}
}
copydirs("test","test2");
?>
okay, now im really confused. the server is windows so i thought permissions didnt matter.but when i execute that script this comes up
Warning: copy(news/templates): failed to open stream: Permission denied in C:\Program Files\Abyss Web Server\htdocs\copyc.php on line 23
news/templates
wibbleandwobble/templatessmillies
Warning: copy(news/smillies): failed to open stream: Permission denied in C:\Program Files\Abyss Web Server\htdocs\copyc.php on line 23
news/smillies
wibbleandwobble/smilliesplugins
Warning: copy(news/plugins): failed to open stream: Permission denied in C:\Program Files\Abyss Web Server\htdocs\copyc.php on line 23
news/plugins
wibbleandwobble/pluginsnews
news.1.php
news/news/news.1.php
wibbleandwobble/news/news.1.phptoc.php
news/news/toc.php
wibbleandwobble/news/toc.phpimg
Warning: copy(news/img): failed to open stream: Permission denied in C:\Program Files\Abyss Web Server\htdocs\copyc.php on line 23
news/img
wibbleandwobble/imgchill
Warning: copy(news/chill): failed to open stream: Permission denied in C:\Program Files\Abyss Web Server\htdocs\copyc.php on line 23
news/chill
wibbleandwobble/chillbasic
Warning: copy(news/basic): failed to open stream: Permission denied in C:\Program Files\Abyss Web Server\htdocs\copyc.php on line 23
news/basic
wibbleandwobble/basic
any ideas???