Ford & Mason Ltd
HOME
ABOUT
CONTACT
RESOURCES
ADVERTISING



donations support the development of
cronolog.org
and
refcards.com

next up previous contents index
Next: GN command line Up: GN cache files Previous: Protocol-dependent menu items


Executing programs to generate documents

GN allows documents and menus to be generated by external programs. As outlined above, an external program will be invoked for general searching, specified as item type 7. Programs can also be specified by using exec or CGI as the initial part of the Path field.

The string exec indicates that the item is generated by an external program. This string is followed by a GN type specifier (see Table gif for a list of valid types), which indicates the type of document that the program generates, a pair of colons, and the relative pathname of the script. Program arguments may be specified between the colons. Such programs can be called in response to Gopher requests as well as HTTP requests.

The following example includes three exec items: the first specifies a program that generates a text file, the second generates a virtual menu and the third an image file:

  Name=Display server usage statistics.
  Path=exec0::/dir/stats-program

Name=Program-generated menu. Path=exec1::/dir/menu-script

Name=Program-generated image. Path=execI::/bin/gnuplot

The initial string CGI in the Path field indicates a program that adheres to the Common Gateway Interface specification (see Section gif). Arguments to the program are included in the URL after the part that identifies the program. The program name must end with the suffix .cgi (or an alternative string specified when the server program was compiled), so that the program name part of the URL can be identified. For example:

  Name=Sample CGI script.
  Path=CGI/bin/script.cgi

This program could be invoked from a Web browser, passing the string `prog-data' by specifying a URL:

  http://www.gnsite.org/CGI/bin/script.cgi/prog-data


next up previous contents index
Next: GN command line Up: GN cache files Previous: Protocol-dependent menu items

[ITCP]Spinning the Web by Andrew Ford
© 1995 International Thomson Publishing
© 2002 Andrew Ford and Ford & Mason Ltd
Note: this HTML document was generated in December 1994 directly from the LaTeX source files using LaTeX2HTML. It was formatted into our standard page layout using the Template Toolkit. The document is mainly of historical interest as obviously many of the sites mentioned have long since disappeared.

 
Copyright © 1996-2002 Ford & Mason Ltd