Monday, November 24, 2008

Windows File Name

Naming Files in Windows According to Ed Bott and Woody Leonhard the following are the requirements for Windows filenames:

1. A filename may contain any alphanumeric character, including the letters A to Z and numbers from 0 to 9.

2. The full filename (including drive letter, colon, backslashes, and folder names) may be as long as 255 characters.

3. The filename itself may be as short as one character.

4. The following special characters are allowed in a filename:   $ % - _ @ ~ ` ' ! ( ) ^ # & + , ; = . [ ] { }

5. Spaces are allowed in filenames.

6. The following special characters are prohibited from being a part of a filename because they have special meanings to the operating system (DOS underlying Windows):
  / \ | : * ? " < >

You'll get an error message if you try to use one of them.

Windows files (and Office files in particular) typically include a three-letter extension, which is added automatically by the program that created the file (such as .doc for files created by Word). However, an extension is not required, nor are extensions limited to three characters. Windows treats any characters following the last period in the filename as an extension.

Source: Special Edition Using Office 2000 by Ed Bott and Woody Leonhard., pp. 73-74 Que. (paraphrased slightly)

Although the above are requirements, they have a couple of recommendations or notes:

  1. They recommend limiting the name of the file itself to about 40 characters so that you don't have trouble moving files with deeply nested folders.
 

2. If you use a nonstandard extension you may have difficulty opening the file from Windows. In Microsoft Office programs files with nonstandard extensions will not appear in file dialog boxes unless you change the file type to All Files.

  3. Windows filenames are not case sensitive. MyFile.doc is treated the same as MYFILE.DOC and myfile.doc. However, if you are publishing to a web page, the web server may be using a different operating system that does pay attention to case.

  4. Word marks temporary files with a beginning tilde (~) character. I would recommend not using this as the beginning character for any file that will be used by any of the MS Office programs.

No comments: