Process flow for query_contents

The job of query_contents CGI program is to return the contents of directories included in a URL request. For example, to get the contents of the root directory of a server's Web space, the browser runs query_contents on a URL such as:

The query_contents script performs the following actions:

  1. Reads the configured value for the DOCROOTDIR variable.

  2. Reads the value of the QUERY_STRING variable from the requested URL to obtain the requested operation and get the object path.

    The operation value is stored in the OPERATION variable. The object path value is stored in the $OBJPATH variable. In the example, the value of the OPERATION variable is dirlist. The value of the OBJPATH variable is /.

  3. Performs a directory listing (DO) on the object path and sends the results to standard output for use by the ISAM server.

    Entries that indicate subdirectories have a double slash (//) appended to them. Typical output looks like:

      100
      index.html
      cgi-bin//
      pics//

    The number 100 is a return status that indicates success.

Parent topic: How to generate a back-end server Web space (query_contents)