File
Management

The following remarks are more technical in nature. If you are only going to use Web content and not produce it, you can skip this. However, if you are going to be producing and serving Web pages, either from your own server or someone elses, there are some technical aspects of file management and transmission that you will probably need to know.

File Management Chores

These "housekeeping chores" for file management may be loosely grouped into the following categories:

  1. File Archiving: the grouping of multiple files or directories into what behaves as a single file for purposes of storage or movement.

  2. File Compression: the transformation of files into a format that is more efficient for storage so that they take up less space on your storage media. For some types of text files efficient compression may reduce the size of the file by factors of 10 or more. For binary files that are already stored in a highly efficient format like GIF files, compression will not have much effect. Some software applications combine archiving and compression functions.

  3. File Encoding: the translation of binary files into a coded form using only ASCII (printable) characters. The resulting encoded file may then be sent by means such as electronic mail that do not normally support the transfer of binary files, and decoded on the other end to yield the original binary file.

  4. Server Uploads and Downloads: if you develop Web files on a machine different from the one that is your Web server, you need systematic methods for transferring new and modified files to the server (uploads) and from the server to your machine for editing (downloads).
The details of each of these procedures will depend on how your computer is set up and how your server is set up. Therefore, we strongly advise that you consult the administrator of your particular server or another local guru for details on how to manage files and transfer them between your machine and the server. However, we include some rather generic material here to get you oriented, and to give you some terminology to use when you consult your local gurus.


File Archiving and Compression

On Macintosh computers archiving and compression (and dearchiving and decompression) are commonly done with the shareware program Stuffit Lite and the freeware program Stuffit Expander. The resulting files normally have a .sit extensions. A commercial version of Stuffit called Stuffit Deluxe is also available. It is a valuable tool to have because it can translate between various archiving and compression algorithms used on non-Macintosh computers.

On Unix systems the common archiving tool is called tar, and compression is normally accomplished using a program called compress or one called gzip. The resulting extensions are normally .tar for tar archives, .Z for Unix compressed files, and .gz for gzipped files. Dearchiving on Unix systems is also accomplished with tar, while uncompress and gunzip will decompress files originally compressed with compress and gzip, respectively (gunzip will also decompress files compressed with Unix compress).

A common Unix operation is to archive a set of files with tar and then compress the archive. The resulting files normally have extensions that are concatenations of the archiving and compression extensions. For example, a tar archive that has been compressed using gzip will normally have .tar.gz as its extension. Such a compressed archive would be converted to the original files and directories by first decompressing with gunzip and then dearchiving with tar.

The Unix archiving and compression tools have been ported to both Macintosh and PC systems, so it is possible to use and manipulate tar, Unix compress, and gzip files on those platforms if you obtain the appropriate software. For example, the commercial versions of Stuffit on the Macintosh have translators to convert these formats, and the shareware programs tar, suntar, and MacGzip implement tar and gzip/gunzip on Macintoshes.

The most common compression/archiving tool on the PC is pkzip, which produces files with a .zip extension. These are dearchived and decompressed with pkunzip. The program WinZip also produces compressed archives on the PC; it can uncompress and/or unarchive files in a number of formats, including archives created with Unix tar and files compressed with both Unix compress and gzip.

Encoding

The most common ASCII encoding on Macintosh computers is BinHex 4.0, and .hqx is the normal extension for such encoded files. The corresponding encoding that is common on Unix systems is called uuencode. BinHex 4.0 also decodes .hqx files, while uudecode decodes uuencoded files for Unix platforms. The Macintosh programs Stuffit and Stuffit Expander can also encode and decode .hqx files, and the commercial program Stuffit Deluxe can also handle uuencoded files.

For transfer of Macintosh binary files over the network it is common that they are archived using Stuffit and then encoded using BinHex 4.0. The resulting files usually have an extension .sit.hqx. The freeware program Stuffit Expander will first decode such a file and then will expand the archive to recover the original files or directories that were archived.

Many mail programs, particularly those commonly available for Windows systems, now support the attachment of binary files to mail messages. Consequently, in many cases encoding/decoding is no longer a matter that one has to deal with when transferring binary files by mail. WinZip can open and extract the contents of files created with either Macintosh BinHex or Unix uuencode, in case you should acquire such files, e.g., via ftp.


Server Uploads and Downloads

The most common form of server upload or download uses the file transfer protocol FTP. Care must be exercised that binary and ASCII files are transferred in the proper mode. Image, sound, and movie files, and executable files like Java class files, are normally binary files; they will become corrupted if you transfer them in ASCII mode. On the other hand, text tiles transferred in binary mode may lose end-of-line information if the platforms between which the transfers are being implemented are different (e.g., from a Macintosh to a Unix server). In this case, the computer will probably still read the text properly, but you may have trouble reading and editing it because the line-wraps will have been changed.

If you have any doubt about the character of a file, you can usually tell if it is binary or ASCII by opening it with a plain text editor (like SimpleText or TeachText for the Macintosh or NotePad for a PC). If the file has strange characters in it (if it resembles the comic strip representation of cursewords) , it is probably binary. The safest option is to transfer it as a binary file if you are uncertain.

If you are going to be uploading files to Network servers, you are also well advised to bear in mind the remarks made previously about case sensitivity and blank spaces in file and directory names.

Finally, if the directory structure for your Web site is complicated you will need some familiarity with directory trees and how to navigate within them on your computer and on your server (see the section on paths and relative addresses). Since these may be different platforms with different directory navigation methods, you may have to be able to do this for more than one system.

We also note that in the case of a complex directory structure it may be advantageous to archive whole sets of directories for transfer between the systems. However, this will depend on the details of the two systems, since you must have the relevant software present on the two systems to archive on one end and dearchive on the other. Consult your local gurus to develop an optimal strategy for file transfer to and from your server.

[ Use the "Back" Button to Return ]