<html>
<! FilePermissions.php                                        >
<! Chapter 10, Oracle Database XE PHP Web Programming         >
<! by Michael McLaughlin                                      >
<!                                                            >
<! This script demonstrates a how to read file statistics and >
<! format UID, GID and date values.                           >
<head>
<title>
  Chapter 10 : FilePermissions.php
</title>
</head>
<body>
<?php
  // Read the parameter from the URL.
  $file = $_GET["p_name"];

  // Format the Octal number.
  print substr(sprintf('%o',fileperms($file)),-4)."<br>";

  // Print the system umask value.
  print "The system umask is [".
         substr(sprintf('%o',umask()),-2)."]";
?>
</body>
</html>