Changing File Permissions and Ownership : chmod « File Directory « PHP






Changing File Permissions and Ownership

 
<?
    chmod("/var/www/myfile.txt", 0777);
    chmod("/var/www/myfile.txt", 0755);

    if (chown("myfile.txt", "sally")) {
            print "File owner changed.\n";
    } else {
            print "File ownership change failed!\n";
    }
?>
  
  








Related examples in the same category

1.Changing file permissions
2.Using the chmod() Function
3.chmod() function changes the mode of filename to permissions.