<html>
<! Status.php                                                 >
<! Chapter 10, Oracle Database XE PHP Web Programming         >
<! by Michael McLaughlin                                      >
<!                                                            >
<! This script demonstrates how to verify whether strings map >
<! to directories, files or files with specific behaviors.    >
<head>
<title>
  Chapter 10 : Status.php
</title>
</head>
<body>
<?php
  // Build the canonical file name.
  $file = realpath($_GET["p_name"]);

  // Print the canonical file name.
  print "The file is: [".$file."]<br>";

  // Checks whether a string maps to a directory.
  if (is_dir($file))
    print "It's a directory.<br />";
  else
    print "It's not a directory.<br />";

  // Checks whether a string maps to a file.
  if (is_file($file))
    print "It's a file.<br />";
  else
    print "It's not a file.<br />";

  // Checks whether a string maps to an executable file.
  if (is_executable($file))
    print "It's executable.<br />";
  else
    print "It's not executable.<br />";

  // Checks whether a string maps to a readable file.
  if (is_readable($file))
    print "It's readable.<br />";
  else
    print "It's not readable.<br />";

  // Checks whether a string maps to a writeable file.
  if (is_writable($file))
    print "It's writeable.<br />";
  else
    print "It's not writeable<br />";
?>
</body>
</html>