G Web Server Examples

Directory Listing CGI

CGIs usually generate HTML documents. Often these document will contain links to other documents or to other CGI applications.

The following CGI interprets its query string as a directory path and generates an HTML document from the contents of the specified directory. The HTML document contains a heading which shows the directory path and a list of files and directories. The directories themselves are links that call the same CGI and use the new encoded directory path as the query string.

/cgi-bin/examples/listdir.vi


© National Instruments