Directory Listing7

HFRD Hypertext Services - Environment Overview

| [next] [previous][contents]


4 - Directory Listing




; A directory listing is sometimes refered to as a document 8Index, and is generally titled ``Index of ...''. 

G Unless disabled by the server's configuration, a directory listing is Orecognised by the server whenever a wildcard is present in a specification and Othere is no query string directing another activity (e.g. a document search). LCompliant with other hypertext implementations, a directory listing is also Mgenerated if a URL specifies a directory only and that directory contains no home page. 

@ All specifications must be made using URL-style paths. DSee 3.1 - Document Specification.

K The directory listing is designed to look very much like the basic layout Nof other servers, except that all directories are grouped at the top. In the Mopinion of the author, this looks and functions better than when interspersedGwith the files, as is otherwise common. The default listing provides: 



I The description can be either be just that, a description of the role ofDthat type of file under VMS, or if presented within quotes, an HTML3document's own internal description taken from the-<TITLE></TITLE> element.

H Note that directory listings only processes the physical file system. EThis may or may not correspond to the hypertext environment's virtual mappings. 

= The following link illustrates the directory listing format:*.* 

VMS-ish Format



D The default listing has a ``generic'' WWW look about it, however it=can be made to look a little more like the format of the VMS >DIRECTORY command. In this mode the directories are Kpresented as VMS subdirectories, the version number is shown, if a version Jwildcard was included in the specification then all matching versions are Ishown, the size is presented in used and allocated blocks, and automatic Oscript activation is disabled. The VMS-style format is enabled by providing anFexplicit or wildcard version number with the specification, as in the following example:*.*; 0

4.1 - Controlling Access To A Directory



G The following files (empty, or not), when within a specific directory Nregulate access to that directory, and the listing of any parent directory or subdirectories. 



4.2 - ``Hidden'' Files




L Any file name beginning with a period is hidden from the directory listing Jmechanism (i.e. in VMS parlance it has only a type/suffix/extension). If Kspecifically accessed they will be retrieved however. Hence the following /files would not appear in a directory listing: 

4.3 - Server Directives




; The HFRD server behaviour can be modified using server Odirectives. For directory listings this involves the inclusion of a query 9string beginning with ?httpd=index. The server Ldetects this query string and processes it internally, changing the default action of directory listings.

L Multiple directives can be combined by concatenating them with intervening %ampersands, as per normal URL syntax.%

  ?httpd=index&autoscript=no  ?httpd=index&readme=no'  ?httpd=index&layout=format,  ?httpd=index&script=script-name:  ?httpd=index&script=script-name&readme=no
2

4.3.1 - Scripting From Directory Listings




L When a directory listing is requested a script name can be specified to be Kused as a prefix to all of the file links in the listing. When the client Bselects a file link the script specified is implicitly activated. *

  ?httpd=index&script=script_nameF  <A HREF="*.*?httpd=index&script=print">print *.*</A>
C

The following link illustrates this facility by specifying the O(print) script. When a link is selected the print script presents a &form to allow the file to be printed: 8

print *.* 

4.3.2 - README Files



< When a directory listing is generated any README.,5README.TXT or README.HTML file (or Oothers as configured for the particualr server) in the directory will have its Icontents displayed immediately below the title of the page. This allows Jadditional information on the directory's contents, function, etc., to be Npresented. This can be suppressed by appending the following query-string to =the directory specification, as in the accompanying example: !

  ?httpd=index&readme=no]  <A HREF="*.*?httpd=index&readme=no">*.* (no <I>readme</I>s)</A>


4.3.3 - Auto-Scripting




2 The server's auto-scripting facility (see e2.1 - Auto-Scripting) can be suppressed by appending the following Mquery-string to the directory specification, as in the accompanying example: %

  ?httpd=index&autoscript=noH  <A HREF="*.*?httpd=index&autoscript=no">get me *.*</A>


I This implies that any file accessed from the listing will be transfered Cwithout any data conversion possible due to script activation (see [Scripts). The browser must then process the document in ;some fashion (often by activating a save as dialog). 

4.3.4 - Layout



D Allows specification of the directory listing layout from the URL, Loverriding the server default. The layout directive is a short string that Nspecifies the included fields, relative placement and optionally the width of Ithe fields in a directory listing. Each field is controlled by a single Oletter and optional leading decimal number specifying its width. When a width Kis not specified an appropriate default applies. An underscore is used to Lindicate a single space and is used to separate the fields (two consecutive works well). 

* As illustrated in the following examples:,
  ?httpd=index&layout=I__L__R__S__D&  ?httpd=index&layout=I__15L__S__D$  ?httpd=index&layout=15L__9R__S%  ?httpd=index&layout=15N_9C_9R_S
F

The following links illustrate this functionality by listing this ?document's directory in a default and then three other formats.

Default.E
Only an icon and link.>
Icon, link and size (in VMS-style format). E
Name, day created andday revised. 

4.4 - Directory Tree



8 The Dtree script allows a directory tree to beGgenerated. This script is supplied with a directory name from which itNdisplays all subdirectories in a hierarchical layout, showing subordinancies. HSelecting any one of the subdirectories displayed generates a directory Hlisting (see 4 - Directory Listing). 

C Appending a file specification (with or without wildcards) to the Jdirectory name results in the any directory listing displaying only files Amatching the specification. To display all files a *.* should always be appended. 

J Note that this script only processes the physical file system. This may Gor may not correspond to the hypertext environment's virtual mappings. 

H To enable the VMS-style directory listing format, or to use any of the Ldirectory server directives, append one, or a combination of, the following .query strings to the directory specification: %

  ?httpd=index&autoscript=no  ?httpd=index&readme=no,  ?httpd=index&script=script-name:  ?httpd=index&script=script-name&readme=no
6

The following links provide online demonstrations:3

/ht_root/ tree@
/ht_root/ (VMS-ish) tree  

G Note that this activity is I/O intensive, and can take a considerable !period if the tree is extensive. 




| [next] [previous][contents]