Learning PHP and MySQL
Example 11-21 Checking the permissions of a file
<?php
$file_name="permissions.php";
if(is_readable($file_name)) {
echo ("The file $file_name is readable.<br>");
}
else {
echo ("The file $file_name is not readable.<br>");
}
if(is_writeable($file_name)) {
echo ("The file $file_name is writeable.<br>");
}
if (is_executable($file_name)) {
echo ("The file $file_name is not writeable.<br>");
}
else {
echo ("The file $file_name is executable.<br>");
}
?>
Our code tells us the many details regarding permissions on the file in Figure 11-17.
Posted by on 08/19 at 08:34 AM