Naming Files and Folders
Outlined below are a few basic rules for naming files and folders. These rules are very conservative; but on something like file-naming, especially files that will be shared with other people (as on the Web), it's wise to err on the conservative side of things. If the file name won't work, the web site or CD-ROM won't work, and the rhetorical task of reaching an audience will fail at the outset.
Basic Rules for Naming Files and Folders
- Always use lower-case letters a through z. Getting into this habit will save you from worrying about whether the URL contains MyFriends, MyFRIENDS, MyFrIeNdS, etc.
- Never use spaces in file names. Both Windows and Macintosh systems encourage us to use spaces in our file names. This is fine for Windows and Mac, but not fine for Web servers and Web browsers. The %20 that shows up in URLs like http://wackysite.com/my%20latest%20news.htm is your browser and a web server trying to compensate for the space. As you can see, the compensation makes the URL even harder to read.
- If you want the effect of a space, use the hyphen: - . It can be helpful, especially in longer file names, to have words separated visually. Use the hyphen to achieve this: http://wackysite.com/my-latest-news.htm. Although one could use the underscore, too, (_), the underscore is usually impossible to detect in URLs that are underlined, as in a default hyperlink. Underscores can also cause problems in certain programming languages if it becomes necessary to refer to an external file. Play it safe, use the hyphen.
- Use numbers with a leading zero. Large, serialized collections of files can be named using numbers to distinguish them, e.g., photo-01, photo-02, photo-03. But use a leading zero (and perhaps a hyphen, too). This will help computers list the files in the order you intend. If you know you'll have less than 100 of something, start with 01 (01-99); if you know you'll have less than 1000 of something, start with 001 (001-999); and so on. On some systems, 2 (rather than 02) will be listed between 19 and 20 (...18, 19, 2, 20...28, 29, 3, 30...), which undercuts the value of serialization.
- In short, never use any characters besides a-z, 0-9, and the hyphenj when naming files and folders/directories. Again, this is a very conservative approach. But certain characters appearing in URLs, like the ? (question mark), & (ampersand), and = (equal sign), have very special meanings that have nothing to do with file names. Play it safe; it'll save you hours of frustration.
Updated on Sun. Aug. 26 2007 at 05:01PM