WWWTar - How It Works

WWWTar is based upon the X Windows tar file viewer XTar. WWWTar processes tar files, which may be compressed with gzip (.gz) or the standard compress (.Z) utility, on the fly.

When WWWTar is invoked with a tar file parameter, it checks to see if the file is compressed (if it is, it forks a process to do the decompression), verifies it is a tar file and reads the header for each file in the archive. This header is converted to a single line of HTML and sent back to the client. The body is also checked to see if it is ascii or binary - ascii files are labelled in the listing.

Each listing includes a header and a footer. These are compiled into WWWTar when it is built. This allows you to add a logo to the top or bottom of each page.

When files are extracted from the tar archive, the filename ending is used to determine the Internet Media Type, using a built-in table. This ensures the users' browser displays the document correctly. For example, .ps files are sent with type application/postscript and .gif files are sent with type image/gif.

Text files are converted to HTML format, with the document header at the top.

Back up to index, or on to Security Considerations.