Necesito cambiar los permisos de los archivos contenidos en un directorio antes de ejecutar un script.
Intento así:
Código PHP:
$modlevel=0777;
$dir = dir("cache/");
if (is_dir($dir) && $handle = opendir($dir)) {
while (false !== ($file = readdir($handle))) {
$filename=$dir."/".$file;
@chmod ($filename, $modlevel);
}
}
Catchable fatal error: Object of class Directory could not be converted to string in /home/myaccount/public_html/folder/chmod2.php on line 4
Cómo puedo hacer para lograr eso ?
Por favor