[0001]
[0002]
[0003]
[0004]
[0005]
[0006]
[0007]
[0008]
[0009]
[0010]
[0011]
[0012]
[0013]
[0014]
[0015]
[0016]
[0017]
[0018]
[0019]
[0020]
[0021]
[0022]
[0023]
[0024]
[0025]
[0026]
[0027]
[0028]
[0029]
[0030]
[0031]
[0032]
[0033]
[0034]
[0035]
[0036]
[0037]
[0038]
[0039]
[0040]
[0041]
[0042]
[0043]
[0044]
[0045]
[0046]
[0047]
[0048]
[0049]
[0050]
[0051]
[0052]
[0053]
[0054]
[0055]
[0056]
[0057]
[0058]
[0059]
[0060]
[0061]
[0062]
[0063]
[0064]
[0065]
[0066]
[0067]
[0068]
[0069]
[0070]
[0071]
[0072]
[0073]
[0074]
[0075]
[0076]
[0077]
[0078]
[0079]
[0080]
[0081]
[0082]
[0083]
[0084]
[0085]
[0086]
[0087]
[0088]
[0089]
[0090]
[0091]
[0092]
[0093]
[0094]
[0095]
[0096]
[0097]
[0098]
[0099]
[0100]
[0101]
[0102]
[0103]
[0104]
[0105]
[0106]
[0107]
[0108]
[0109]
[0110]
[0111]
[0112]
[0113]
[0114]
[0115]
[0116]
[0117]
[0118]
[0119]
[0120]
[0121]
[0122]
[0123]
[0124]
[0125]
[0126]
[0127]
[0128]
[0129]
[0130]
[0131]
[0132]
[0133]
[0134]
[0135]
[0136]
[0137]
[0138]
[0139]
[0140]
[0141]
[0142]
[0143]
[0144]
[0145]
[0146]
[0147]
[0148]
[0149]
[0150]
[0151]
[0152]
[0153]
[0154]
[0155]
[0156]
[0157]
[0158]
[0159]
[0160]
[0161]
[0162]
[0163]
[0164]
[0165]
[0166]
[0167]
[0168]
[0169]
[0170]
[0171]
[0172]
[0173]
[0174]
[0175]
[0176]
[0177]
[0178]
[0179]
[0180]
[0181]
[0182]
[0183]
[0184]
[0185]
[0186]
[0187]
[0188]
[0189]
[0190]
[0191]
[0192]
[0193]
[0194]
[0195]
[0196]
[0197]
[0198]
[0199]
[0200]
[0201]
[0202]
[0203]
[0204]
[0205]
[0206]
[0207]
[0208]
[0209]
[0210]
[0211]
[0212]
[0213]
[0214]
[0215]
[0216]
[0217]
[0218]
[0219]
[0220]
[0221]
[0222]
[0223]
[0224]
[0225]
[0226]
[0227]
[0228]
[0229]
[0230]
[0231]
[0232]
[0233]
[0234]
[0235]
[0236]
[0237]
[0238]
[0239]
[0240]
[0241]
[0242]
[0243]
[0244]
[0245]
[0246]
[0247]
[0248]
[0249]
[0250]
[0251]
[0252]
[0253]
[0254]
[0255]
[0256]
[0257]
[0258]
[0259]
[0260]
[0261]
[0262]
[0263]
[0264]
[0265]
[0266]
[0267]
[0268]
[0269]
[0270]
[0271]
[0272]
[0273]
[0274]
[0275]
[0276]
[0277]
[0278]
[0279]
[0280]
[0281]
[0282]
[0283]
[0284]
[0285]
[0286]
[0287]
[0288]
[0289]
[0290]
[0291]
[0292]
[0293]
[0294]
[0295]
[0296]
[0297]
[0298]
[0299]
[0300]
[0301]
[0302]
[0303]
[0304]
[0305]
[0306]
[0307]
[0308]
[0309]
[0310]
[0311]
[0312]
[0313]
[0314]
[0315]
[0316]
[0317]
[0318]
[0319]
[0320]
[0321]
[0322]
[0323]
[0324]
[0325]
[0326]
[0327]
[0328]
[0329]
[0330]
[0331]
[0332]
[0333]
[0334]
[0335]
[0336]
[0337]
[0338]
[0339]
[0340]
[0341]
[0342]
[0343]
[0344]
[0345]
[0346]
[0347]
[0348]
[0349]
[0350]
[0351]
[0352]
[0353]
[0354]
[0355]
[0356]
[0357]
[0358]
[0359]
[0360]
[0361]
[0362]
[0363]
[0364]
[0365]
[0366]
[0367]
[0368]
[0369]
[0370]
[0371]
[0372]
[0373]
[0374]
[0375]
[0376]
[0377]
[0378]
[0379]
[0380]
[0381]
[0382]
[0383]
[0384]
[0385]
[0386]
[0387]
[0388]
[0389]
[0390]
[0391]
[0392]
[0393]
[0394]
[0395]
[0396]
[0397]
[0398]
[0399]
[0400]
[0401]
[0402]
[0403]
[0404]
[0405]
[0406]
[0407]
[0408]
[0409]
[0410]
[0411]
[0412]
[0413]
[0414]
[0415]
[0416]
[0417]
[0418]
[0419]
[0420]
[0421]
[0422]
[0423]
[0424]
[0425]
[0426]
[0427]
[0428]
[0429]
[0430]
[0431]
[0432]
[0433]
[0434]
[0435]
[0436]
[0437]
[0438]
[0439]
[0440]
[0441]
[0442]
[0443]
[0444]
[0445]
[0446]
[0447]
[0448]
[0449]
[0450]
[0451]
[0452]
[0453]
[0454]
[0455]
[0456]
[0457]
[0458]
[0459]
[0460]
[0461]
[0462]
[0463]
[0464]
[0465]
[0466]
[0467]
[0468]
[0469]
[0470]
[0471]
[0472]
[0473]
[0474]
[0475]
[0476]
[0477]
[0478]
[0479]
[0480]
[0481]
[0482]
[0483]
[0484]
[0485]
[0486]
[0487]
[0488]
[0489]
[0490]
[0491]
[0492]
[0493]
[0494]
[0495]
[0496]
[0497]
[0498]
[0499]
[0500]
[0501]
[0502]
[0503]
[0504]
[0505]
[0506]
[0507]
[0508]
[0509]
[0510]
[0511]
[0512]
[0513]
[0514]
[0515]
[0516]
[0517]
[0518]
[0519]
[0520]
[0521]
[0522]
[0523]
[0524]
[0525]
[0526]
[0527]
[0528]
[0529]
[0530]
[0531]
[0532]
[0533]
[0534]
[0535]
[0536]
[0537]
[0538]
[0539]
[0540]
[0541]
[0542]
[0543]
[0544]
[0545]
[0546]
[0547]
[0548]
[0549]
[0550]
[0551]
[0552]
[0553]
[0554]
[0555]
[0556]
[0557]
[0558]
[0559]
[0560]
[0561]
[0562]
[0563]
[0564]
[0565]
[0566]
[0567]
[0568]
[0569]
[0570]
[0571]
[0572]
[0573]
[0574]
[0575]
[0576]
[0577]
[0578]
[0579]
[0580]
[0581]
[0582]
[0583]
[0584]
[0585]
[0586]
[0587]
[0588]
[0589]
[0590]
[0591]
[0592]
[0593]
[0594]
[0595]
[0596]
[0597]
[0598]
[0599]
[0600]
[0601]
[0602]
[0603]
[0604]
[0605]
[0606]
[0607]
[0608]
[0609]
[0610]
[0611]
[0612]
[0613]
[0614]
[0615]
[0616]
[0617]
[0618]
[0619]
[0620]
[0621]
[0622]
[0623]
[0624]
[0625]
[0626]
[0627]
[0628]
[0629]
[0630]
[0631]
[0632]
[0633]
[0634]
[0635]
[0636]
[0637]
[0638]
[0639]
[0640]
[0641]
[0642]
[0643]
[0644]
[0645]
[0646]
[0647]
[0648]
[0649]
[0650]
[0651]
[0652]
[0653]
[0654]
[0655]
[0656]
[0657]
[0658]
[0659]
[0660]
[0661]
[0662]
[0663]
[0664]
[0665]
[0666]
[0667]
[0668]
[0669]
[0670]
[0671]
[0672]
[0673]
[0674]
[0675]
[0676]
[0677]
[0678]
[0679]
[0680]
[0681]
[0682]
[0683]
[0684]
[0685]
[0686]
[0687]
[0688]
[0689]
[0690]
[0691]
[0692]
[0693]
[0694]
[0695]
[0696]
[0697]
[0698]
[0699]
[0700]
[0701]
[0702]
[0703]
[0704]
[0705]
[0706]
[0707]
[0708]
[0709]
[0710]
[0711]
[0712]
[0713]
[0714]
[0715]
[0716]
[0717]
[0718]
[0719]
[0720]
[0721]
[0722]
[0723]
[0724]
[0725]
|1Directory Listing|

|^ A directory listing is sometimes refered to as a document  |/Index||, and is
generally titled "Index of |...|". 

|^ Unless disabled by the server's configuration, a directory listing is 
recognised by the server whenever a wildcard is present in a specification and 
there is no query string directing another activity (e.g. a document search).  
Compliant with other web implementations, a directory listing is also 
generated if a URL specifies a directory only and that directory contains no 
home page. 

|^ |*All specifications must be made using URL-style paths.|
See |link|Document Specification||.

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

|simple#|
|item| iconic indication of the data type
|item| file name
|item| last revison date/time
|item| size
|item| description
|!simple|

|^ The description can be either just that, a description of the role of that
type of file under VMS, or if presented within quotes, an HTML document's own
internal description taken from the "<title></title>" element.

|^ Note that directory listings only processes the physical file system.  
This may or may not correspond to the web environment's virtual mappings. 

|^ The following link illustrates the directory listing format:
|link%|/wasd_root/wasdoc/*.*|

|0VMS-ish Format||

|^ 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 presented as VMS
subdirectories, the version number is shown, if a version wildcard was
included in the specification then all matching versions are shown, the size
is presented in used and allocated blocks, and automatic script activation is
disabled. The VMS-style format is enabled by providing an explicit or wildcard
version number with the specification, as in the following example:
|link%|/wasd_root/wasdoc/*.*;|

|0Listing Icons||

|^ By default (and generally) WASD installations are configured to return a
binary file for unknown content-types (usually triggering a browser
"save-as" dialog).  For such files, and in fact all files in general, a
directory listing icon is usually a link to a plain-text version of the file
(regardless of the actual content).  This becomes convenient way to access the
content for files with "interesting" file name extensions and the actual
markup of HTML source files, etc.  Of course some files containing non-textual
data will be variously displayed as gibberish depending on the browser.

|note|
|0YMMV|
Some browsers and operating systems insist they know better than the server and
ignore the response-specified content-type, inferring presentation of the
content from |/magic bytes|| in that content or the trailing
dot-separated |/file name extension||.
|!note|

|2Controlling Access To A Directory|

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

|bullet|

|item| |*=..WWW_HIDDEN |-| | 
Renders the directory completely invisible to the directory listing  mechanism. 
Files within the directory may still be accessed if specified  explicitly but
the directory content itself cannot be listed by any means. 

|item| |*=..WWW_NOWILD |-| | 
Renders the directory incapable of being listed using "*.*" characters
at the end of the path, even if allowed by the server.  This is a little
different to .WWW_HIDDEN, which hides the directory completely.  The
|/no-wild|| still allows a directory without a home page to list as a
directory, it does however |*prevent the forced listing using the
"*.*" syntax||.

|item| |*=..WWW_NOP |-| | 
Any parent directory is not listed.

|item| |*=..WWW_NOS |-| | 
Any subdirectories are not listed.

|item| |*=..WWW_NOPS |-| | 
Any parent directory or subdirectories are not listed.

|!bullet|

|2."Hidden" Files|

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

|mono|
.WWW_NOPS
.CANT_BE_SEEN
.HIDDEN_FROM_VIEW
.;1
.WWW_WASD
|!mono|

|2Server Directives|

|^ The WASD server behaviour can be modified using |/server 
directives||.  For directory listings this involves the inclusion of a query 
string beginning with "?httpd=index".  The server detects this URI
query string and processes it internally, changing the default action of
directory listings.

|^ Multiple directives can be combined by concatenating them with intervening 
ampersands, as per normal URI syntax.

|code|
?httpd=index&autoscript=no
?httpd=index&readme=no
?httpd=index&type=text/plain
?httpd=index&layout=|/format||
?httpd=index&script=|/script-name||
?httpd=index&script=|/script-name||&readme=no
?httpd=index&delimit=none&readme=no&nos=yes
|!code|

|^ Server directives specified in the URI propagate when moving between
directories unless the query string also contains

|code|
&local=yes
|!code|

|3..WWW_WASD|

|^ The control file .WWW_WASD can be used to contain server directives. 
Directives are generally included one per line with "#" prefixed comment
lines allowed.

|^ When a .WWW_WASD file is present in a directory it takes precedence over
any SSI or URI (query string) directives also being applied, unless it includes
an |/override=yes|| directive.  When this is present any SSI and/or URI
directive string is also applied to the request.

|code|
# an example .WWW_WASD file
autoscript=no
readme=no
style=sort2
sort=s-
override=yes
|!code|

|3Layout|

|^ Allows specification of the directory listing layout from the URL,
overriding the server default. The layout directive is a short,
case-insensitive string that specifies the included fields, relative placement
and optionally the width of the fields in a directory listing. Each field is
controlled by a single letter (one with colon-separated parameter) and
optional leading decimal number specifying the width. When a width is not
specified an appropriate default applies. An underscore is used to indicate a
single space and is used to separate the fields (two consecutive works well). 

|simple#|

|item| |*C |-| | creation date
|item| |*D |-| | description (often best specified last)

|simple#|
|item| |*D:L |-| | for files, make a link out of the description text
|!simple|

|item| |*I |-| | icon (takes no field-width attribute)

|simple#|
|item| |*L |-| | link (highlighted anchor using the name of the file)
|item| |*L:F |-| | file-system name (for ODS-5 displays spaces, etc.) 
|item| |*L:N |-| | name-only, do not display the extension
|item| |*L:U |-| | force name to upper-case
|!simple|

|item| |*N |-| | name (no link, why bother? who knows!)
|item| |*O |-| | owner (can be disabled)
|item| |*R |-| | revision date
|item| |*S |-| | size

|simple#|
|item| |*S:B |-| | in bytes (comma-formatted)
|item| |*S:D |-| | decimal kilos (see below)
|item| |*S:F |-| | kilo and mega are displayed to one decimal place
|item| |*S:K |-| | in kilo-bytes (and fractions thereof)
|item| |*S:M |-| | in mega-bytes (and fractions thereof)
|!simple|

|item| |*U |-| | upper-case file and directory names (must be the
first character)

|!simple|


|^ The default layout is:

|code|
I__L__R__S__D
|!code|

|^ The following provide other examples:

|code|
?httpd=index&layout=UI__L__R__S__D
?httpd=index&layout=I__L__R__S:b__D
?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
|!code|

|^ |*By default the size of files is calculated as 1024 byte
kilos.||

|^ When using the "S:D", the size is displayed as per "F" with
1000 byte kilos.  If it is prefered to have the default display in 1000 byte
kilos then set the directory listing layout using:

|code|
?httpd=index&layout=I__L__R__S:d__D
|!code|

or explicitly direct the "kilo" quantity to 1000 with

|code|
?httpd=index&layout=I__L__R__S:0__D
|!code|

to 1024 (as per VMS /UNIT=BYTES) with

|code|
?httpd=index&layout=I__L__R__S:2__D
|!code|

with or without an explicit size directive

|code|
?httpd=index&layout=I__L__R__S:2:K__D
|!code|

The following links illustrate the difference between the "kilo" values:

|table|
|~ |. |link%=|/wasd_root/wasdoc/*.*?httpd=index&layout=I__L__R__S:0__D| |. (1000)
|~ |. |link%=|/wasd_root/wasdoc/*.*?httpd=index&layout=I__L__R__S:2__D| |. (1024)
|!table|

|^ If unsure of the kilo value being used check the
"<meta>" information in the directory listing.

|^ The following links illustrate this functionality by listing this 
document's directory in various formats.

|table|
|~ |. |link%=|/wasd_root/wasdoc/*.*|
   |. Default
|~ |. |link%=|/wasd_root/wasdoc/*.*?httpd=index&layout=I__L| 
   |. Only an icon and link.
|~ |. |link%=|/wasd_root/wasdoc/*.*;?httpd=index&layout=I__L__S|
      |. Icon, link and size (in VMS-style format). 
|~ |. |link%=|/wasd_root/wasdoc/*.*?httpd=index&layout=N__9C__9R|
   |. Name, day created and day revised.
|~ |. |link%=|/wasd_root/wasdoc/*.*?httpd=index&layout=UN__9C__9R|
   |. Name (in upper-case), day created and day revised.
|~ |. |link%=|/wasd_root/wasdoc/*.*?httpd=index&layout=30D:l__S:b__R|
   |. Description (fixed width) as a link, size in bytes, and day revised.
|!table|

|3Directory Style|

|^ WASD has a default directory listing style where the page title is a series
of links to the various directories in the path, then column labels are
separated from directory links by a horizontal line, the after the listed
directories a blank line, and the listed files, followed by another horizontal
line, all in monospace font.  There have been a small number of variations on
this over the years.  The current default (post-v10.4) style is implemented
using an HTML table and differs from the historical preformatted text approach.

|^ For each style there is a second variant where the horizontal lines
partitioning the listing are not present.

|^ The various directory listing styles are illustrated below.

|table|
|~ |. |link%=|/wasd_root/wasdoc/*.*|
|~ |. |link%=|/wasd_root/wasdoc/*.*?httpd=index&style=default2|
|~ |. |link%=|/wasd_root/wasdoc/*.*?httpd=index&style=sort|
|~ |. |link%=|/wasd_root/wasdoc/*.*?httpd=index&style=sort2|
|~ |. |link%=|/wasd_root/wasdoc/*.*?httpd=index&style=anchor|
|~ |. |link%=|/wasd_root/wasdoc/*.*?httpd=index&style=anchor2|
|~ |. |link%=|/wasd_root/wasdoc/*.*?httpd=index&style=htdir|
|~ |. |link%=|/wasd_root/wasdoc/*.*?httpd=index&style=htdir2|
|~ |. |link%=|/wasd_root/wasdoc/*.*?httpd=index&style=original|
|~ |. |link%=|/wasd_root/wasdoc/*.*?httpd=index&style=original2|
|!table|

|0Sortable Listing||

|^ There is also a useful alternate style that allows manual, automatic and
programmatic sorting of the listing content.  The sort is performed by
JavaScript and does not require a re-request of the server.  A sortable listing
is indicated by |&letter-spacing:-4px;.\&#9660;\&#9650;||\&nbsp;
in the header icon column (if present).  When a column has been sorted
ascending/descending symbols are present adjacent to the column label.
The taper of the symbol shape |&letter-spacing:-4px;.\&#9660;||\&nbsp;
indicating larger/later to smaller/earlier top to bottom (descending), and
|&letter-spacing:-4px;.\&#9650;||\&nbsp; smaller/earlier to larger/later top to
bottom (ascending).  Manual sorting is accomplished by clicking on the column
label.  This reverses the current sort order.

|^ The examples above include the basic sortable listing.

|^ The sortable listing by default generates the standard WASD ascending by
name listing.  It is also possible to automatically sort a listing on a
particular column when it is generated.  This is done with an additional
parameter specifying the layout column character as used in
|\|link|<REFERENCE>(sect_directory_layout)||.  The default is to list top-to-bottom
ascending order.  An optional "-" lists top-to-bottom in descending
order (the redundant "+") is also accepted.

|^ Examples of automatic sort on size, descending size, revision data and
descending revision date are below.

|table|
|~ |. |link%=|/wasd_root/wasdoc/*.*?httpd=index&style=sort&sort=s|
|~ |. |link%=|/wasd_root/wasdoc/*.*?httpd=index&style=sort2&sort=s-|
|~ |. |link%=|/wasd_root/wasdoc/*.*?httpd=index&style=sort&sort=r+|
|~ |. |link%=|/wasd_root/wasdoc/*.*?httpd=index&style=sort2&sort=r-|
|!table|

|^ Programmatic listing from JavaScript embedded in a README.HTML or enclosing
SSI document can be performed by calling the wasdDirSort() function with a
string parameter containing the column character and optional order character.
The following example sorts descending by size.

|code|
<script language="JavaScript">wasdDirSort('S-')</script>
|!code|

|^ To make all directory listings for a server or site sortable, place the
following mapping rule appropriately close to the top of relevant mapping
rules.

|code|
SET * dir=style=sort
|!code|

|3Selective Listing|


|^ The WASD directory listing permits the use of VMS wildcards in the file
specification.  This directly allows selected listings of files.  For example,
all files, all the SDML files in this document's directory, all the HTML files,
and finally all the files containing 01 in the name.

|table|
|~ |. |link%=|/wasd_root/wasdoc/*.*|
|~ |. |link%=|/wasd_root/wasdoc/*.wasdoc|
|~ |. |link%=|/wasd_root/wasdoc/*.html|
|~ |. |link%=|/wasd_root/wasdoc/*0*.*|
|!table|

|^ In addition, it is possible to selectively include and/or exclude selected
files using the server directive |/?httpd=index&these=||. The parameter
is one or more, comma-separated file name specifications which may contain
wildcards.  The directory listing usually would have file name and type
wildcard (though can be a selector in itself) and then files are selected using 
using the above directive.  If a selector is preceded by an exclamation point
("!") this excludes matching files.  Matching is first to last and the
first match hit is applied.

|^ The following examples provide the equivalent listings to the examples above.

|table|
|~ |. |link%=|/wasd_root/wasdoc/*.*?httpd=index&these=*|
|~ |. |link%=|/wasd_root/wasdoc/*.*?httpd=index&these=*.wasdoc|
|~ |. |link%=|/wasd_root/wasdoc/*.*?httpd=index&these=*.html|
|~ |. |link%=|/wasd_root/wasdoc/*.*?httpd=index&these=*0*.*|
|!table|

|^ This example lists all of the files above in the one listing.

|table|
|~ |. |link%=|/wasd_root/wasdoc/*.*?httpd=index&these=*.wasdoc,*.html,*01*.*|
|!table|

|^ This example lists all files except those with an .HTML type.

|table|
|~ |. |link%=|/wasd_root/wasdoc/*.*?httpd=index&these=!*.html|
|!table|

|3Listing Title|

|^ The listing (page) title may be explicitly supplied using the
|/?httpd=index&title=..|| directive.

|^ The keywords parallel those provided for path mapping |/SET dir=title=..||.

|^ |simple#|
|item| "0" (digit zero) suppress any title
|item| "1..99" where 1 is the top-level directory (device), 2 is the
second-level directory, 3 |...| 99 the current directory
|item| "DEFAULT" the default for the directory |/style|
|item| "OWNER" the VMS account owning the directory
|item| "REMOTE" the remote user name (for X509 authentication the certificate
common-name)
|item| "THIS=<string>" a literal string
|!simple|

|3Listing Font|

|^ Historically and by default, directory listings are provided in a monospace
font.  The parent document or browser (proprtional) font may be used instead
with the |/?httpd=index&font=inherit|| directive.  This can only be used with
the sortable and tabular (post-v10.4) listings.  Historical listing styles are
only suitable for monospace fonts.

|table|
|~ |. |link%=|/wasd_root/wasdoc/*.*?httpd=index&font=inherit|
|!table|

|^ There is the per-path  |/SET dir=font=inherit|| mapping rule equivalent.

|3File Versions|

|^ As described above, a directory listing can be requested in a |/VMSish|
style by appending a version delimter to the URL file specification, with
multiple versions of the file, where they exist, displayed with version number.

|^ Multiple versions may also be selectively listed using the
|/?httpd=index&versions=| directive.  The parameter can be an integer
representing the maximum number of versions to be listed, or an asterisk
wildcard indicating all versions should be listed.

|code|
?httpd=index&versions=0
?httpd=index&versions=3
|!code|

|table|
|~ |. |link%=|/wasd_root/wasdoc/*.*?httpd=index&versions=*|
|!table|

|^ There is the per-path  |/SET dir=versions=|| mapping rule equivalent.

|3Readme Files|

|^ When a directory listing is generated any "README.", "README.TXT" or
"README.HTML" file (or  others as configured for the particular server) in the
directory will have the  contents displayed immediately below the title of the
page.  This allows  additional information on the directory's contents,
function, etc., to be  presented.  This can be suppressed by appending the
following query-string to  the directory specification, as in the accompanying
example: 

|table|
|~ |. |link%=|/wasd_root/wasdoc/*.*?httpd=index&readme=no|
|!table|

|^ Read-me files can be SSI documents if configured by the server
administrator. General SSI guidelines apply to these, see
|link|Server-Side Includes (SSI)|

|3Listing Delimiters|

|^ A directory listing is normally delimited by a header, comprising an
"Index of", column headings and horizontal line, and a footer,
comprising a horizintal line.  This default behaviour may be modified using the
"delimit=" directive.

|bullet#|
|item| |*header |-| | 
a header comprising a horizontal rule and column heading is generated
|item| |*footer |-| | 
a footer comprising a horizontal rule is generated
|item| |*none |-| | 
no header or footer is generated
|item| |*both |-| | 
both header and footer is generated (default)
|!bullet|

|code|
?httpd=index&delimit=none
?httpd=index&delimit=top
|!code|

|3Suppressing Directories|

|^ Parent and subdirectories may be suppressed in a listing using the "nop",
"nops" and "nos" directives.  These parallel the purpose of the directory
listing control files described in |link|Controlling Access To A Directory||,
and if set to true suppress the listing of the corresponding directories.

|bullet#|
|item| |*nop |-| | 
any parent directory is not listed
|item| |*nops |-| | 
any subdirectories are not listed
|item| |*nos |-| | 
any parent directory or subdirectories are not listed
|!bullet|

|code|
?httpd=index&nop=yes
?httpd=index&nops=yes
?httpd=index&nos=yes
|!code|

|3Listing Refresh and Expiry|

|^ Directory listings and trees may be |/pre-expired||.  That is, the listing
is reloaded each time the page is referenced.  This is convenient in some
environments where directory contents change frequently, but adds considerable
over-head and so is often disabled by default.  Individual directory listings
may have either default behaviour over-ridden using syntax similar to the
following examples:

|code|
/dir1/dir2/*.*?httpd=index?expired=yes
/dir1/dir2/*.*?httpd=index?expired=no
/tree/dir1/dir2/?httpd=index?expired=yes
/tree/dir1/dir2/?httpd=index?expired=no
|!code|

|3Scripting From Directory Listings|

|^ When a directory listing is requested a script name can be specified to be 
used as a prefix to all of the file links in the listing.  When the client 
selects a file link the script specified is implicitly activated. 

|code|
?httpd=index&script=script_name
|!code|

|^ The following link illustrates this facility by specifying the  |/liner|
script.  When a link is selected the |/liner| script presents the file with
preprended line numbers:

|table|
|~ |. |link%=|/wasd_root/wasdoc/*.*?httpd=index&script=/cgi-bin/liner|
|!table|

|3Auto-Scripting|

|^ The server's |/auto-scripting|| facility (see description of
[AddType] configuration  directive in the Technical Overview) can be suppressed
by appending the following  query-string to the directory specification, as in
the accompanying example:

|code|
?httpd=index&autoscript=no
|!code|

|table|
|~ |. |link%=|/wasd_root/wasdoc/*.*?httpd=index&autoscript=no|
|!table|

|^ This implies that any file accessed from the listing will be transfered 
without any data conversion possible due to script activation.  The browser
must then process the document in  some fashion (often by activating a |/save
as| dialog).

|3Target Window|

|^ Files generally open in the current browser window.  It is possible to open
a file in another window using the |/target=| directive.

|code|
?httpd=index&target=_blank
|!code|

|table|
|~ |. |link%=|/wasd_root/wasdoc/*.*?httpd=index&target=_blank|
|!table|

|^
|9Browser (HTML) Supported Targets|
|*Browser (HTML) Supported Targets|
|table|
|~_ |: Target|: Description
|~
|~ |. _blank |. opens the file in a new window or tab
|~ |. _self |. in the same frame
|~ |. _parent |. in the parent frame
|~ |. _top |. in the full body of the window
|~ |. |/framename| |. in a named frame
|!table|

There is a per-path mapping "SET dir=target=" equivalent.

|3Specifying Content-Type|

|^ When accessing files it is possible to explicitly specify the identifying
content-type to be returned to the browser in the HTTP response header.  Of
course this does not change the actual content of the file, just the header
content-type!  This is primarily provided to allow access to plain-text
documents that have obscure, non"-standard" or non-configured file extensions.
See |link|Explicitly Specifying Content-Type.||.

|^ It could also be used for other purposes, "forcing" the browser to accept a
particular file as a particular content-type.  This can be useful if the
extension is not configured (as mentioned above) or in the case where the file
contains data of a known content-type but with an extension conflicting with an
already configured extension specifying data of a different content-type.

|^ It is posssible to "force" the content-type for all files in a particular
directory.  Enter the path to the directory and then add

|code|
?httpd=index&type=text/plain
|!code|

|^ (or what-ever type is desired).  Links to files in the listing will contain
the appropriate "?httpd=content&type=..." appended as a query string.

|^ This is an example:

|table|
|~ |. |link%=|/wasd_root/wasdoc/*.*|
|~ |. |link%=|/wasd_root/wasdoc/*.*?httpd=index&type=text/plain|
|!table|

|note|
|0YMMV|
Some browsers and operating systems insist they know better than the server and
ignore the response-specified content-type, inferring presentation of the
content from |/magic bytes| in that content or the trailing dot-separated
|/file name extension||.
|!note|

|3Icon Plain Text Link|

|^ Directory listing icons are generally links to the content of the file
displayed as plain-text (|link|Listing Icons||).  This can be disabled using
the |/ilink| directive.

|code|
?httpd=index&ilink=no
|!code|

|table|
|~ |. |link%=|/wasd_root/wasdoc/*.*&ilink=no|
|!table|

There is a per-path mapping "SET dir=noilink"  equivalent.

|3Query String|

|^ The |/query=<string>| directive can be used to propagate an explicit query
string to subsequent directory requests.  This is intended to be applied from a
|=..WWW_WASD| control file because actual URI query strings are propagated by
default.

|code|
# an example .WWW_WASD file
query=httpd=index&style=sort2&sort=s-
|!code|

|3Allowing Override|

|^ When a |=..WWW_WASD| file is present in a directory it takes precedence over
any SSI or URI (query string) directives also available, unless it includes an
|/override=yes| directive.  When this is present any SSI and/or URI directive
string is also applied to the request.

|code|
# an example .WWW_WASD file
override=yes
|!code|

|2Directory Tree|

|^ The "Tree" internal script allows a directory tree to be  generated.  This
script is supplied with a directory name from which it displays all
subdirectories in a hierarchical layout, showing subordinancies.  Selecting any
one of the subdirectories displayed generates a directory listing (see
|link|Directory Listing||). 

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

|^ Note that this script only processes the physical file system.  This may 
or may not correspond to the web environment's virtual mappings. 

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

|code|
?httpd=index&autoscript=no
?httpd=index&readme=no
?httpd=index&script=|/script-name||
?httpd=index&script=|/script-name||&readme=no
|!code|

|^ The following links provide online demonstrations:

|table|
|~ |. |link%=|/tree/wasd_root/wasdoc/*.*|
|~ |. |link%=|/tree/wasd_root/wasdoc/*.*;| |. VMS-ish
|!table|

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