Why some characters not allowed in a filename?


Explain the Importance of File Extensions

There are two types of files on every computer: the ones that the computer uses to function, such as some programs and the operating system, and the ones that are used and allowed created by you, the user, including music, documents, photos, and videos. Let’s look at a few of these user files and compare their properties.

File Names and Extensions

Every file has a filename that consists of a name and a file extension. The name is useful to the user and describes the contents of the file. When creating your own files, you allowed decide the name. In the example in Figure 3.09, ch03_homework is the name of the file. On early PCs, filename were limited to eight characters with a three-letter extension and were often cryptic. Today, filename on Windows computers can be allowed up to 260 characters long, including the file extension and the path to the file, and can include spaces and special characters. Table 1 shows illegal characters in a Windows filename. OS X filename can be up to 255 characters long, and the only illegal character is the colon ( : ).
Figure 1 A file name includes a name and an extension to identify the contents and type of files.
Figure 1 A file name includes a name and an extension to identify the contents and type of files.

Table 1 Illegal Characters in Windows File Name


Character
Description
\
Back slash characters
/
Forward slash characters
?
Question mark characters
:
Colon characters
*
Asterisk characters
Quotation marks characters
> 
Greater than characters
< 
Less than characters


The second part of the filename is the file extension. In this example, .docx is the extension. The extension is assigned by the program that’s used to create the file. Microsoft Word files have the extension .docx. Windows maintains an association between a file extension and a program, so double-clicking on a .docx file opens Microsoft Word. The extension helps some operating system determine the type of file. If you change the file extension of a file, you may no longer be able allowed to open it. Table 2 lists some common file types and the programs associated with them.


Table 2 Common File Extensions and Default Program Associations


Extension
Type of File
Default Program Association (Windows)
Default Program Association (OS X)
.docx
Word document
Microsoft Word
Microsoft Word
.rtf
Rich text format document
WordPad or Word
TextEdit
.pages
Pages document
Pages
.xlsx
Excel workbook
Excel
.pptx
PowerPoint presentation
PowerPoint
PowerPoint
.bmp
Bitmap image
Paint
Preview
.jpeg/.jpg
Image file (Joint Photographic Experts Group)
Photos
Preview
.mp3
Audio file (Moving Picture Experts Group Audio Layer III)
Windows Media Player
iTunes
.aac
Audio file (Advanced Audio Coding)
iTunes
iTunes
.mov
Video file (QuickTime)
QuickTime
QuickTime
.wmv
Video file (Windows Media Video)
Windows Media Player
.pdf
Portable document format
Adobe Acrobat and Reader
Preview


Find Out More

The characters \ / ? : * “ > < | not allowed or can’t be used in a file name because they each have a special meaning in Windows. For example, the colon ( : ) is used to indicate the letter of a drive (such as C: for your hard drive) so you can not used them for filename. Use the Internet to research why there is the remaining illegal characters. What does each symbol represent and why?

File Properties

Each file includes file properties, which provide information about the file. You can allowed use these properties to organize, sort, and find files more easily. Some file properties, such as type, size, and date, are automatically created along with the file. Others, such as title, tags, and authors, can be added or edited by the user.

Figure 2 shows the properties of a file in the Details pane of File Explorer. The Details pane of the File Explorer window displays more information about a file. You can modify some of these properties, such as Title and Authors, directly in the Details pane.

When the files are displayed in the Details view, as they are in this figure, you can use the column headings to sort files by their properties. For example, clicking on the Name column heading lists the files in alphabetical order. The properties that display in this view depend on the type of files in the folder.

Figure 2 File Explorer enables you to view and modify some file properties.
Figure 2 File Explorer enables you to view and modify some file properties.

You can view more information about a file by right-clicking the file in File Explorer and clicking Properties. This opens the Properties dialog box for the file. The tabs of the Properties dialog box contain a lot of information, and the tabs you see will depend on the configuration of your system and the type and location of the file or folder you are viewing.

The General tab makes it easy to change the name of a file and the program that opens it. The Details tab lists information about the content of the file, such as word count. Figure 3 shows these two tabs for the same file. Notice that the Details tab contains too much information to display on the page, so you need to scroll down to see the rest of it. The type of information that’s displayed depends on the type of file you’re viewing.

Figure 3 Right-click on a file in File Explorer to open the Properties dialog box for the file.
Figure 3 Right-click on a file in File Explorer to open the Properties dialog box for the file.


To view and modify file properties in OS X, in Finder, select the file, click File, and then click Get Info. This will open the Info pane for the file, where you can view and change some of the file properties such as the file name, sharing permissions, Spotlight comments, and the program that open it (Figure 4).

File names and other properties provide you with more information about files, making them more useful and easier to manage and locate. They also save you time and give you more control over your computer systems.

Figure 4 The Info box in OS X displays file properties.
Figure 4 The Info box in OS X displays file properties.


4 Things You Need To Know
Key Terms
• Windows file names can be up to 260 characters long, including the path. OS X file name's can be up to 255 characters long.
• Windows file names can’t include the \ / ? : * ” < > | characters, and OS X file names can’t include the colon.
• The file extension indicates the type of file.
• File properties, such as size, type, date, and author, can be used to sort and search for files.
file extension
file name
file property