note 40159 added to function.chown
| From: | greg_at_rhythmicdesignd dot o dot tcom at rn2 dot php dot net | Date: | Mon, 23 Feb 2004 21:00:10 +0000 |
| Subject: | note 40159 added to function.chown | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-65611@lists.php.net to get a copy of this message | ||
function recurse_chown_chgrp($mypath, $uid, $gid)
{
$d = opendir ($mypath) ;
while(($file = readdir($d)) !== false) {
if ($file != "." && $file != "..") {
$typepath = $mypath . "/" . $file ;
//print $typepath. " : " . filetype ($typepath). "<BR>" ;
if (filetype ($typepath) == 'dir') {
recurse_chown_chgrp ($typepath, $uid, $gid);
}
chown($typepath, $uid);
chgrp($typepath, $gid);
}
}
}
recurse_chown_chgrp ("uploads", "unsider", "unsider") ;
for older versions.. unfortunately, it seems I do not have permission to perform these functions.
----
Manual Page -- http://www.php.net/manual/en/function.chown.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+40159
Delete -- http://master.php.net/manage/user-notes.php?action=delete+40159&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+40159&report=yes
Search -- http://master.php.net/manage/user-notes.php