Section 1.8. Files, Folders, and Disks


1.8. 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.

1.8.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:


A:

Represents the first "floppy" (usually 3.5-inch) disk drive on the system


B:

Represents the second floppy disk drive, if present


C:

Represents the first hard disk drive or the first partition of the first hard disk drive


D:

Often represents a DVD-ROM or CD-ROM drive, but can represent an additional hard disk drive or other removable drive


E: through Z:

Represent additional hard disk drives, DVD-ROM or CD-ROM drives, Universal Serial Bus (USB) flash drives, removable cartridges such as ZIP or Jaz drives, or mapped network drives

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:.

1.8.2. Pathnames

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.

1.8.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: (which has been shared as o), located on a computer named shoebox.

1.8.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.

The maximum length of any path in Windows Vista depends on the filesystem you're using (NTFS, FAT32, etc.).

1.8.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:


.xls

An Excel spreadsheet


.txt

A text file (to be opened with Notepad)


.html

A HyperText Markup Language (HTML) file, commonly known as a web page


.jpg

A JPEG image file, used to store photos

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 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.



Windows Vista Pocket Reference
Windows Vista Pocket Reference: A Compact Guide to Windows Vista (Pocket Guides)
ISBN: 0596528086
EAN: 2147483647
Year: N/A
Pages: 63

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net