The application/http-index-format
file format is an attempt to provide a generic, extensible file listing format that is principly machine readable.
Syntax
Every line in the file must conform to the following generic syntax:
NUMBER: DATA
where NUMBER is at least a three digit number (note that more digits are possible in the future) and DATA is separated from NUMBER by a colon and a space. The syntax of DATA is defined by the syntax spec for every NUMBER type. If a NUMBER is encountered that a parser does not understand the parser is required to ignore that line. There is no line length limit. All lines must be terminated by a carriage return followed by a line feed.
NUMBER codes
100
A human readable comment line. Machine parsers should ignore this data. This data is not intended for display to the end user and is only meant as a comment to make the file format clear to a human interpreter.
101
Pre formatted human readable information line. This data is intended for the end user of the file format data if there is one. This data should be presented to the user when they are viewing data drawn from the file.
102
A human readable information line in HTML format. This data is intended for the end user of the file format data if there is one. This data should be presented to the user when they are viewing data drawn from the file. This data should be parsed as HTML.
200
Defines the field names for the 201 file index code. A valid 200 line consists of one or more white space separated tokens that describe the name or purpose of the associated column of data. Tokens may not contain spaces. Any illegal characters must be escaped via the URL escaping syntax defined by RFC 1738. Note that multiple 200 lines override previous 200 lines.
201
Data whose definition stems from a prior 200 line. A valid 201 line consists of one or more white space separated tokens that represent data described by a previous 200 line. Tokens may be quoted or unquoted. Unquoted tokens may not contain white space. Quoted tokens are terminated by the next quote but may not contain carrage returns or new lines. Any illegal characters must be escaped via the URL escaping syntax defined by RFC 1738. Note that a 201 line encountered before a 200 line should be ignored.
300
A URL pointing to the directory represented by the index if there is one. A valid path token must be URL escaped.
Valid 200 tokens
Note that all tokens are case insensitive.
Filename
The name of file that can be used to retrieve the file when combined with the full path provided by the 300 line. White space and 8 bit characters must be URL encoded.
Content-Length
Base 10 digits representing the size of the file in bytes. Only digits are legal.
Last-Modified
RFC 1123 date format URL encoded.
Content-type
MIME content type. Whitespace and 8-bit characters must be URL-encoded. The MIME-type for a directory can be given as application/http-index-format
.
File-type
One of the following keywords to represent a special status for a file:
- FILE
- DIRECTORY
- SYMBOLIC-LINK
- SYM-FILE (a symbolic link to a file)
- SYM-DIRECTORY (a symbolic link to a directory)
Permissions
UNIX type file permission syntax. 3 slots either 'R', 'W', 'X', or '-' representing, in order, Read, Write, or Execute permissions. A '-' indicates that the particular permission is not set. Example "RW-" means read and write permission, but not execute.
Example
100: This is a comment! Do not present to the end-user
100:
101: The files in this directory are put forth for public
101: consumption and the provider make no guarentee as
101: as to the functionality of the data or programs
101: presented.
100:
300: ftp://test.netscape.com/u/montulli
100:
200: Filename Content-Length Content-Type File-type Last-Modified
201: foo.txt 512 Text/Plain FILE Tue,%2015%20Nov%201994%2008:12:31%20GMT
201: bar.html 9683 text/Html FILE Tue,%2025%20Oct%201994%2008:12:31%20GMT
201: foobar 0 application/http-index-format DIRECTORY Tue,%2025%20Oct%201994%2008:12:31%20GMT
Original Document Information
- Author(s): Christian Biesinger
- Last Updated Date: May 10, 2004
- Copyright Information: Portions of this content are © 1998–2007 by individual mozilla.org contributors; content available under a Creative Commons license | Details.