[previous] [next] [top] [search] [index]

Ranges


If the server receives a request like
     /dir/foo;lines=20-30

and file is any text/* document it will return a text/plain document consisting of lines 20 through 30 of file foo. This is very useful for structured text files like address lists or digests of mail and news. A WN utility called digest will produce an HTML file with a list of links to separate sections (line ranges) of the structured file. It is described below.

The option ;lines=[first],[last] can be appended to the URL of any text file served by the WN server. It has the effect causing the server to return line [first] through line [last] of the document to which it is attached. It is ignored and an error is logged if it is used with a binary file. When used with a text file the content type of the returned document is set to text/plain since, for example, a range of lines from an HTML document is unlikely to be a valid HTML document. For any file, including binaries, the server will honor a byte range. A request for

     /dir/foo;bytes=256-1024

will cause the server to return bytes 256 to 1024 inclusive. The content type of the returned document will be text/plain if the document foo is a text document and application/octet-stream otherwise.

The Digest Utility

The digest utility is executed with two regular expressions: one to match the section separator and the other to match the section title. For a mail digest named foo, for example, the command
     digest foo "^From" "^Subject:"

will produce an HTML file called foo.index.html which contains an unordered list of anchors. Each has as title the content of the Subject line of a mail message in foo and href the range of lines in foo containing that particular message. More detailed information on the use of digest is in the chapter on utilities.


WN -- for those who think the Web should be more than a user friendly interface to ftp

John Franks <john@math.nwu.edu>
[previous] [next] [top] [search] [index]