Appendix: GN Internal Types Each "Path" field in a gn menu file contains an entry known as a _selector_. The format of this selector is a _gn internal type_ field followed by the path relative to the gn root directory of the file referenced. The gn internal type indicates to the server what kind of document or file is referenced. It can be a single character like "0" to indicate a text file, or a more complicated string. Here is a list of the types and what they mean. _0_ -- Plain text This is a normal ASCII text file; the Mime content type used is _text/plain_ _0h, 1h_ -- Plain text and html (two files) Items of type 0h are represented by two files, _filename_ or _filename.txt_ and _filename.html_ which are plaintext and HTML versions of the same document. The server will return the HTML version to HTTP clients and the plaintext version to gopher clients. Content types are text/plain and text/html respectively. Type 1h works similarly returning a menu corresponding to _dirname_ to gopher clients and an HTML document _dirname.html_ to HTTP clients. _1_ -- Menu Items of this type correspond to directories in the _gn_ hierarchy. From the menu file in this directory the server produces an HTML document for HTTP clients and a gopher protocol directory for gopher clients. _1m_ -- Structured file Items of this type are files consisting of many smaller "documents" like a mail file. The server presents a menu of these smaller documents and when one is selected returns the appropriate part of the file. See the section on Structured Files). _1s_ -- Searchable Menu Like type _1_ but allows items in this menu to be searched with grep searches. See the section on Searching a Collection of Files. _2_ -- CSO or "ph" URL (link) The gn server does nothing with these links except give the URL (or gopher equivalent) to the client to handle. _3_ -- Error This type is reserved for error messages. It should not be used in a menu file. _4, 5, 6_ -- Binhex, DOS .exe, and uuencoded files These types refer to Mac binhex, DOS binaries and UNIX uuencoded files respectively. The server treats types 4 and 6 (binhex and uuencoded) exactly like text files and type 5 (DOS binaries) like type 9 binary files. _7_ -- Maintainer defined search or response to client supplied string An item of this type refers to a program or script provided by the server maintainer. This program should take an input string and respond with output in the format of a .cache file (see Technical notes). _7c_ -- Menu keyword search This item refers to a directory in the _gn_ hierarchy, typically the root directory. When selected it is selected the user is prompted for a search term (any grep like regular expression). The server returns a menu of all menu items in the hierarchy at or below the given directory which contain matches for the regular expression. See section above on "Searching all menus." _7g_ -- Grep searches This item refers to a directory in the _gn_ hierarchy, containing a number of files. When this item is selected the server prompts the user for a regular expression search term and returns a menu of all those files which contain a match for that regular expression See the section on Searching a Collection of Files. _7m_ -- Search a structured file This item refers to an item of type '1m' as described above. When this item is selected the server prompts the user for a regular expression search term and returns a menu of all those documents in the referenced file which contain a match for that regular expression See the section on Structured Files). _7w, 7wc, 7wh, 7wr_ -- WAIS index searches These items refer to a WAIS index in the _gn_ hierarchy, containing an index of a collection of files in the hierarchy. When this item is selected the server prompts the user for a search term and returns a menu of all those files which contain a match. Type 7wc indicates that the menu item titles should be taken from the .cache files containing the documents rather than use what WAIS thinks the title should be (typically the filename). Type 7wh indicates that the indexed items should be type 0h, i.e. there is both a plaintext and an html version of each file. Type 7wr indicates a "range type", where a single file is considered to contain a number of documents, e.g. a mail file. See the waisgn users guide for more details. _8_ -- Telnet URL (link) The gn server does nothing with these links except give the URL (or gopher equivalent) to the client to handle. _9, I, s_ -- Binary files, Image files, Sound files These files are treated as binary data and downloaded appropriately. To determine its Mime content type the file gn_mime.types is consulted and compared with the filename extension. This can be overridden by a ContentType= entry in the menu file. See the section above on MIME Content-Type. _0Z, 9Z, IZ, sZ_ -- Compressed files These types refer to files of type 0, 9, I, and s respectively, but the files in question are kept on the server in a compressed format. When a client requests one of these files it is automatically uncompressed before transmission to that client. See the section above on Compressed Files. _exec0, exec1, exec7, exec9, execI, execs_ -- execute a command These types cause the server to execute a program provided by the maintainer. The last character indicates the type of item the program or script will return, i.e. '0' for text, '1' for directory etc. See the section above on Serving the Output of a Program or Script. _R123-345-1m, R123-345-range_ These types should not be entered in a menu file by the maintainer. They are used internally by the server for menu items which correspond to documents which consist of all the characters in a certain range of a file. "R123-345-1m", for example, would refer to the "document" consisting of bytes 123 to 345 of a file which has a type 1m menu entry. Similarly R123-345-range refers to a document returned as a match of a WAIS index search (type 7wr). John Franks -- Dept of Math. Northwestern University .