answersLogoWhite

0

What are acceptable file names?

Updated: 10/25/2022
User Avatar

Wiki User

6y ago

Best Answer

It depends on the file systems supported by the operating system. Most file systems use the concept of files and directories (or folders) to access data stored on a device. File names and directory names usually follow the same naming conventions on a given system. Every file and directory has a set of attribute bits (flags) associated with it and one of those attributes is the directory bit. If the bit is set, the name refers to a directory otherwise the name refers to a file.

On the older MS-DOS FAT file system, file and directory names are limited to 8 characters for the base name and 3 for the extension, commonly referred to as an 8.3 file name. The dot separator is considered part of the file name, thus file names are limited to a maximum of 12 characters. The newer Windows FAT and NTFS file systems support longer file names, but in order to retain backward compatibility with the older FAT system, file names that do not conform to the 8.3 file naming convention are automatically given a second short file name that does conform. Such files can therefore be referred to by either name. For example, the "C:\Program Files" folder can be referred to as "C:\PROGRA~1". Note that any file name with a space character is considered a long file name because the 8.3 naming convention does not support space characters.

You may use any characters in the current code page for a name, including Unicode characters and characters in the extended character set (128-255), except for the following characters:

  • < (less than)
  • > (greater than)
  • : (colon)
  • " (double quote)
  • / (forward slash)
  • \ (backslash)
  • | (vertical bar or pipe)
  • ? (question mark)
  • * (asterisk)

In addition, the following restrictions apply:

  • Integer value zero, sometimes referred to as the ASCII NUL character.
  • Characters whose integer representations are in the range from 1 through 31, except for alternate data streams where these characters are allowed.
  • Any other character that the target file system does not allow.

The following names are also reserved and cannot be used to name a file or directory:

  • CON
  • PRN
  • AUX
  • NUL
  • COM1, COM2, COM3, COM4, COM5, COM6, COM7, COM8 and COM9
  • LPT1, LPT2, LPT3, LPT4, LPT5, LPT6, LPT7, LPT8, and LPT9

Note that although the newer FAT and NTFS file systems allow mixed-case file names, they are not case-sensitive by default. That is, "TEMP", "Temp" and "temp" all refer to the same file or directory. However, when searching for files, you can use case-sensitivity to filter out unwanted files. For example, searching for "T*" with case-sensitivity turned on will find only those files that begin with a capital 'T'.

Under the newer FAT and NTFS system, the Windows API imposes a maximum length of a fully-qualified path to 260 characters including the terminating null character. Given a fully-qualified path name is of the form volume:\component(s), the maximum length for any one component (file or directory name) is 256 characters. However, the Windows API also supports Unicode versions which permit extended-length paths of up to 32,767 characters with a maximum component length of 255 characters. To specify an extended-length path, use the "\\?" prefix. For example, "\\?\D:\very long path".

Note that the shell and the file system have different requirements thus it is possible to create a path using the Windows API that the shell user interface is not able to interpret correctly.

User Avatar

Wiki User

6y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What are acceptable file names?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering
Related questions

How do you petition for a name change?

You complete an acceptable petition and file it at the courthouse.


Is it legal to file taxes without signature?

Legal...Yes..but acceptable as a complete filing...NO.


What file is used to translate host names to IP addresses?

Hosts file


File names almost always contain what at the end of the file name?

Extension


Can you fax your resume?

Yes, where the employer states that it is acceptable. You can send it as an attachment file with online faxing.


Can you use spaces in your file names?

yes


How do you file names in a filing system?

alphabetically


Which of these methodologies allows long file names?

NTFS-New Technology File System


Which of methodologies allows long file names?

NTFS-New Technology File System


Which of the file names below follows standard file naming convention?

BUS-APP_QUZ_CH02_V01


What file names are legal under the windows xp file naming rules?

See this URL for some discussion of Windows file names: http://msdn.microsoft.com/en-us/library/aa365247.aspx


What parameter of fsutil defines whether 8.3 character file names are generated and whether extended characters are accepted in 8.3 file names on ntfs?

Behavior