For When You Can't Have The Real Thing
[ start | index | login ]
start > Windows > File Naming Rules

File Naming Rules

Created by dave. Last edited by dave, 12 years and 197 days ago. Viewed 7,496 times. #2
[diff] [history] [edit] [rdf]

File Naming Conventions In Windows

See: >>

Naming a File

Although each file system can have specific rules about the formation of individual components in a directory or file name, all file systems follow the same general conventions: a base file name and an optional extension, separated by a period.

For example, the MS-DOS FAT file system supports 8 characters for the base file name and 3 characters for the extension. This is known as an 8.3 file name. The FAT file system and the NTFS file system are not limited to 8.3 file names, because they support a long file name. Naming Conventions

The following rules enable applications to create and process valid names for files and directories regardless of the file system:

  • Use a period (.) to separate the base file name from the extension in a directory name or file name.
  • Backslashes () are used to separate components in paths, which divides the file name from the path to it, or one directory from one another in a path. You cannot use backslashes in file or directory names. However, they can be required as part of volume names, for example, "C:". UNC names must adhere to the following format:
  • Use any character in the current code page for a name, except characters in the range of 0 through 31, or any character that the file system does not allow. A name can contain characters in the extended character set (128–255). However, it cannot contain the following reserved characters:
< > : " / \ |
  • The following reserved device names cannot be used as the name of a file: CON, PRN, AUX, NUL, COM1, COM2, COM3, COM4, COM5, COM6, COM7, COM8, COM9, LPT1, LPT2, LPT3, LPT4, LPT5, LPT6, LPT7, LPT8, and LPT9. Also avoid these names followed by an extension, for example, NUL.tx7.
Windows NT: CLOCK$ is also a reserved device name.
  • Do not assume case sensitivity. Consider names such as OSCAR, Oscar, and oscar to be the same.
  • Do not end a file or directory name with a trailing space or a period. Although the underlying file system may support such names, the operating system does not.
  • Use a period (.) as a directory component in a path to represent the current directory.
  • Use two consecutive periods (..) as a directory component in a path to represent the parent of the current directory.
no comments | post comment
This is a collection of techical information, much of it learned the hard way. Consider it a lab book or a /info directory. I doubt much of it will be of use to anyone else.

Useful: | Copyright 2000-2002 Matthias L. Jugel and Stephan J. Schmidt