Posted By

Wiederkehr on 03/18/10


Tagged


Versions (?)

Recursive CHMOD with PHP


 / Published in: PHP
 

  1. <?phpfunction chmod_R($path, $filemode) {$dh = opendir($path);while ($file = readdir($dh)) {if($file != '.' && $file != '..') {$fullpath = $path.'/'.$file;echo 'chmod ' .$filemode.' '.$fullpath. "<br />";chmod($fullpath, $filemode);echo '<br />';if(is_dir($fullpath)) {chmod_R($fullpath, $filemode);} }}closedir($dh);}chmod_R('.', 0777);?>

Report this snippet  

You need to login to post a comment.