W3C libwww Using

Bindings to the local File system

The preferences that we described in section Request Preferences did not mention what libwww should do if it doesn't know the data format of a document. In many protocols this information is provided by the remote server. Typical examples are MIME like protocols where the metainformation such as the Content-Type and the Content-Language is provided together with the document. However, applications often have access to the local file system using file URLs which in general do not keep any or at least very little information of the file type. It is therefore required to have some kind of binding between the file system and the preferences registered in the Library which provides this mateinformation about the object.

Often files in a file system is classified by some sort of a suffix, for example GIF files are often ending in .gif, text files in .txt etc. This binding is not static and it is therefore required to have a dynamic binding just like the preferences themselves. An example of the latter is HTML files which on most Unix systems end in .html whereas they on many MS-DOS based systems end in .htm.

The HTBind module provides a generic binding mechanism between a file and its representation internally in libwww. It is not limited to simple file suffix classification but can also be used in more advanced environments using data bases etc. However, at this point we are interested in how we can register bindings between file suffixes and for example content types, content languages etc. The Bind manager is born with a certain knowledge about the set of delimiters but more can be added to provide the functionality desired.

DocumentationAdding and Deleting Bindings


Henrik Frystyk Nielsen, libwww@w3.org,
@(#) $Id: Bind.html,v 1.14 1996/12/09 03:23:36 jigsaw Exp $