2.7. Files, Folders, and Disks
Files are the basic unit of long-term storage on a computer. Files are organized into folders, which are stored on disks. (In DOS, Unix, and earlier versions of Windows, folders were more often referred to as directories, but both terms are still used.) This section reviews fundamental filesystem concepts, including file-and disk-naming conventions and file types.
2.7.1. Disk Names
Like every version of Windows that preceded it, Windows Vista retains the basic DOS disk-naming conventions. Drives are differentiated by a single letter of the alphabet followed by a colon:
By default, drive letters are assigned consecutively, but it's possible to change the drive letters for most drives so that you can have a drive N: without having a drive M:. (See Chapter 4 for details.)
Folders, which contain files, are stored hierarchically on a disk and can be nested to any arbitrary level.
The filesystem on any disk begins with the root (top-level) directory, represented as a backslash. Thus, C:\ represents the root directory on the C: drive. Each additional nested directory is simply listed after its "parent," with backslashes used to separate each one. C:\Windows\System\Color means that the Color folder is in the System folder in the Windows folder on the C: drive. Thus, you can express a path to any given folder as a single string of folder names.
A path can be absolute (always starting with a drive letter) or relative (referenced with respect to the current directory). The concept of a current directory is somewhat obsolete in Windows Vista, as it was in Windows NT, Windows 2000, and Windows XP, with the exception of commands issued from the command prompt. Each Command Prompt window has an active folder associated with it, to which each command is directed. For example, if the current directory is C:\windows, and you type DIR (the directory listing command), you would get a listing of the files in that folder. If you then type CD cursors, the current directory would become C:\windows\cursors.
The fact that the entire absolute path was not needed after the CD command is an example of the use of a relative path.
A special type of relative path is made up of one or more dots. The names . and .. refer to the current directory and the parent of that directory, respectively (C:\windows is the parent folder of C:\windows\cursors, for example). Type CD .. while in C:\windows, and the current directory becomes simply C:\. Use of additional dots (such as ...) in some previous versions of Windows is not supported in Windows XP or Vista. The graphical equivalent of .. is the yellow folder icon with the curved arrow, found in common file dialogs.
The left pane (Navigation Pane) in Windows Explorer (by default) contains a hierarchical tree-structured view of the filesystem. The tree structure makes it easier to navigate through all the folders on your system because it provides a graphical overview of the structure. See Chapter 3 for more information on the tree and Chapter 4 for more information on the Windows Explorer application.
2.7.3. Paths to Network Resources
You can refer to files on any shared network via a Universal Naming Convention (UNC) pathname, which is very similar to a path (described in the preceding section). The first element of a UNC pathname is the name of the computer or device that contains the file, prefixed by a double backslash. The second element is the device's share name. What follows is the string of folders leading to the target folder or file.
For example, the UNC path \\shoebox\o\hemp\adriana.txt refers to a file named adriana.txt, located in the hemp folder, located on drive O:, located on a computer named shoebox.
For more information on UNC pathnames and sharing resources on a network, see Chapter 7.
2.7.4. Short Names and Long Names
DOS and Windows 3.1, the Microsoft operating systems that preceded Windows 95 and Windows NT, only supported filenames with a maximum of eight characters, plus a three-character file type extension (e.g., myfile.txt). The maximum length of any path was 80 characters (see "Pathnames," earlier in this chapter, for more information on paths). Legal characters included any combination of letters and numbers, extended ASCII characters with values greater than 127, and the following punctuation characters:
$ % ^ ' ` - _ @ ~ ! ( ) # &
Spaces were not allowed.
Windows Vista supports long filenames (up to 260 characters), which can include spaces as well as these punctuation characters:
$ % ^ ' ` - _ @ ~ ! ( ) # & + , ; = [ ] .
For example, a file could be named Picture of my Niece.jpg and could be located in a folder named Family Photos. Furthermore, extensions are no longer limited to three characters; for example, .html is perfectly valid (and distinctly different from .htm). For more information on file types and extensions, see the discussions in the next section and in Appendix D.
The maximum length of any path in Windows Vista depends on the filesystem you're using (NTFS, FAT32, etc.).
2.7.5. File Types and Extensions
Most files have a filename extension, the (usually three) letters that appear after the last dot in any file's name. Here are some common file extensions:
Although each of these files holds very different types of data, the only way Windows differentiates them is by their filename extensions. How Windows is able to determine a given file's type is important for several reasons, especially because it is the basis for the associations that link documents with the applications that created them. For example, when you double-click on a file named donkey.html, Windows looks up the extension in the Registry (see Chapter 13) and then, by default, opens the file in your web browser. Rename the file to donkey.jpg, and the association changes as well.
The lesson here is that filename extensions are not a reliable guide to a file's type, despite how heavily Windows Vista relies on them. What can make it even more frustrating is that, by default, known filename extensions are hidden by Windows Vista, but unfamiliar extensions are shown. Rename donkey.xyz (an unassociated extension) to donkey.txt, and the extension simply disappears in Windows Explorer. Or, try to differentiate donkey.txt from donkey.doc when the extensions are hidden. To instruct Windows to show all extensions, go to Control Panel Appearance and Personalization Folder Options View, and turn off the "Hide file extensions for known file types option.
To see all of the configured file extensions on your system, go to Start Default Programs Associate a file type or protocol with a program. Youll see a list of all your file types, along with the programs with which they are associated. To change the default program for any file type, highlight the file type, click "Change program," and then select the new program with which the file should be associated.
2.7.6. Using Windows Explorer
Click on a folder icon in Windows Explorer, and you'll see the contents of the folder. Look at the Preview Pane (it's on by default, but if it has been turned off for some reason, turn it on via Organize Layout) for the number of items in the folder.
Windows Explorer has received a major makeover with Windows Vista, and although the basic function is the same (navigating through your hard disk, viewing and using files, etc.), the layout and features have changed. (For a detailed look at Windows Explorer, see Chapter 4.) Figure 2-8 shows the major features of Windows Explorer.
Figure 2-8. The updated Windows Explorer
You can turn panes on and off by choosing Organize Layout, and selecting or deselecting the panes you want.
There's another major change to Windows Explorer with Windows Vistathe menus have vanished. To make them appear for a single task, press the Alt key. To keep them on permanently, choose Organize Folder and Search Options Layout View, and check the box next to Always show menus.
Depending on your settings, the files in the folder may be displayed in any of seven different ways: Tiles, Details, List, Small Icons, Medium Icons, Large Icons, and Extra Large Icons. In the Details view, each file is represented by a small icon, and several rows of information are displayed about each file, such as date created, date modified, size, and so on. In the List view, the files are displayed in a single long list. Small Icons, Medium Icons, Large Icons, and Extra Large Icons do exactly what they say: display each file as an icon representation, in whatever size you've chosen. (See Figure 2-9.) Different files will have different icon behaviors. With graphics files, for example, the icons are actual thumbnails of the graphic. But Word files display only the Word icon, not the actual content of the file itself. The Tiles view is a kind of combination of the List and Icon viewsit displays the files as tiled icons, without columns of details but with basic information about the file next to each tile, including the name, type, and size of the file.
Figure 2-9. Sort folder listings by clicking on column headers, or change column widths by dragging boundaries between the headers
If you're looking at a folder full of images, any of the icon views will be most useful. The Tiles view is worthwhile if you want to see small icons in addition to basic file information.
If you want to see previews of the actual content of your files, you can turn on the Preview Pane. It appears on the right and shows a thumbnail of the current file you've highlighted. The Preview Pane works in any view. To turn it on, select Organize Layout Preview Pane. The icon next to the Preview Pane on the menu will become highlighted in blue, and the pane turns on. To turn it off, select Organize Layout Preview Pane, and the highlight around the icon will vanish, as will the pane.
You can change the columns displayed in the Details view. Right-click on any column, and from the list that appears select the file types you want displayed. In addition, you can change the sort order and display of any column by hovering your mouse over the column until a down arrow appears, then clicking the down arrow. You'll be presented with ways in which you can sort and display that column.
In certain instances you can also turn on a Search Pane, which will appear just above the toolbar. The pane works in concert with the Search Bar. Type in a search term, and the Search Pane lets you easily filter your search results by file typesuch as Email, Pictures, and so onby clicking on the appropriate button. To turn the Search Pane on, select Organize Layout Search Pane. The Search Pane icon will be highlighted in blue on the menu, and the pane turns on. To turn it off, select Organize Layout Search Pane, and the highlight will vanish, as will the pane. However, the Search Pane is only available this way in a few folders, such as Desktop and Computer. If you choose Organize Layout in other folders, the Search Pane option will not be available. However, in any folder, if you type any text into the Search box, you can make the Search Pane appear by choosing Organize Layout Search Pane. But when you delete the text from the Search box, you wont have the option of turning on the Search Pane, except in a few select folders, such as Desktop and Computer.
Windows Vista will remember the view setting for each folder by default and will display it the same way the next time the folder is opened. (If a long time passes before you open a folder again, though, Windows will forget its settings.) You can turn this setting off by selecting Organize Folder Options View, unchecking the box next to "Remember each folders view settings," and then clicking OK.
The Explorer Toolbar, like toolbars in most applications, provides quick access to some of the more frequently used features. The toolbar is context-sensitive; that is, it changes according to the content of the folder that you're viewing.
The Address Bar does more than just display your current folder; you also use it for navigation. Either move down the "bread crumb" trail that is displayed there, or else type the path to a folder and press Enter, and the folder's contents will be shown in the current window. This is often faster than navigating with the folder tree or using several consecutive folder windows. See Chapter 3 for details on using the Address Bar.
Although each new folder window you open will appear with Microsoft's default settings, it's possible to modify those defaults. Start by configuring a folder according to your preferences: choose the icon size, the sort order, and so on. Then, go to Organize Folder Options View, and click Apply to Folders. The setting will then be used for each new single folder window that is opened.
When you open a new folder, it opens in your existing Windows Explorer window. You can, however, have folders open in new windows instead. Choose Organize Folder Options General, select "Open each folder in its own window," and click OK.
2.7.7. Keyboard Accelerators in Folder Windows
Some keyboard accelerators are especially useful in Explorer and folder windows. You can use these in addition to the various keys described in "Point-and-Click Operations," earlier in this chapter.
2.7.8. Advanced Drag-and-Drop Techniques
Some of the basics of drag-and-drop are discussed in "Point-and-Click Operations," earlier in this chapter, but you can use some advanced techniques to have more control when you're dragging and dropping items. Naturally, it's important to be able to anticipate what will happen when you drag and drop an item before you actually do the dropping. The problem is that drag-and-drop is handled differently in various situations, so sometimes you'll need to modify your behavior to achieve the desired result. Here are the rules that Windows follows when determining how dropped files are handled:
If you have trouble remembering these rules, or if you run into a confusing situation, you can always fall back on the information Windows provides you while you're dragging, in the form of the mouse cursor. A blue right-pointing arrow appears next to the pointer when copying, and a curved arrow appears when creating a shortcut. If you see no symbol, the object will be moved. This visual feedback is very important; it can eliminate a lot of mistakes if you pay attention to it.
Here's how to control what happens when you drag and drop an item: