HTML Basics
Stanford University Libraries & Academic Information Resources

Dealing with files

 [Previous Page]  [Tutorial Top]  [Tech Guide]  [Next Page]

Before we can start marking up a document there are a few mechanics to take care of. If your document is fairly small and you expect to be able to contain it completely within a single file (e.g. a resumé, a short article, etc), then you simply need to arrive at a reasonable filename, which must end in


If your document (work) is more complex and will involve more than one file, it is almost always wise to create a directory (folder) for all of its component files. You may also, if it makes sense, create subdirectories of that directory (folders within folders) to hold groups of like files. For example, if you are creating a document to hold your latest book Cataloging Standards for the Twenty First Century, you might create a directory called catstand, and then within that directory create subdirectories like this

      (The main document, preface, index, table of contents go here)
          (all your images go here)
          (14 inspired sections on the use of subfields go here)

By doing this, you make it possible to move your entire work, as a single piece, to a new location and, in general, make it easier to maintain the work. It also allows you to re-use filenames (imagine not being able to use the name "Chapter 1" again).

Notes for DOS, Windows, Macintosh, and Unix users

DOS/Windows and Macs have different sets of restrictions on what you can name a file.

DOS & Windows
DOS filenames can be up to 8 characters long and have a 3 character extention, and contain a fairly restricted set of characters. Filenames are not case-sensitive and directory structure is indicated with backslashes thus: c:\foo\bar\bas
Macs, on the other hand, allow long file names, and permit the use of exotic characters including spaces and nonprinting characters. Filenames are case-sensitive and directory (folder) structure is designated with colons thus: disk:foo:bar:bas
Like the Mac, Unix has permissive bent, but has a different set of permitted characters and requires special handling for filenames with spaces and other oddball characters. Filenames are case-sensitive and directory structure is indicated with forward slashes thus: /foo/bar/bas

Guideline and conventions

All of this leads to headaches when documents are moved from one environment to another. Fortunately most servers and clients are pretty smart about this problem, so we can stick to a few guidelines to make life a little simpler. If you can manage it reasonably, try to name your documents according to these rules of thumb.

 [Previous Page]  [Tutorial Top]  [Tech Guide]  [Next Page]

Walter Henry
Stanford University Libraries and Academic Information Resources