Read an Excerpt
Chapter 14: FilesystemsOne important aspect of any operating system is the way in which it manages files. In good old MS-DOS, managing files is about all the operating system did, especially when 16-bit Windows was running on top of it. 16-bit Windows pretty much took care of everything except the manipulation of files on hard disks and floppy disks, which it left up to MS-DOS. (As time went on, though, 16-bit Windows took on more of even this responsibility by adding direct 32-bit access support and going right to the disk controller to manipulate the system's paging file.)
Now both Microsoft Windows 95 and Microsoft Windows NT have greatly enhanced 32-bit file support for managing the user's files and drives. In fact, both of these operating systems sport an installable file system that is capable of supporting multiple file systems-all of them simultaneously.
The main file system of Windows 95 is the File Allocation Table (FAT) file system. Windows NT also supports the FAT file system. The FAT file system supports file and directory names up to 255 characters long. These names are stored on the disk using Unicode. Using Unicode to store filenames means among other things that files will retain their names when they are copied to systems that use different languages. The FAT file system also associates three time stamps with each file: when the file was created, when the file was last accessed, and when the file was last modified.
In addition to the FAT file system, Windows NT supports the NT file system (NTFS). The NTFS file system offers all of the features of the FAT file system plus some additional ones. The most important feature of NTFS is a file system recovery scheme that allows for quick restoration of disk-based data after a system failure. Other features of NTFS allow you to manipulate extremely large storage media. Several security features, such as execute-only files (which make it far more difficult for a virus to attach itself to an application), have been added. For POSIX compatibility, NTFS supports file system features such as hard links, casesensitive filenames, and the ability to retain information regarding when a file was last opened.
NTFS was designed to be extended. Features that will be supported include transaction-based operations to support fault tolerant applications, user-controlled version numbers for files, multiple data streams per file, flexible options for file naming and file attributes, and support for the popular file servers. For security-minded installations, NTFS will certainly become the standard, and it should eventually replace the FAT file system standard.
The CD-ROM File System (CDFS) is used specifically for a CD-ROM drive, once considered a high-ticket peripheral for a personal computer. Today a CD-ROM drive is becoming more a necessity than a luxury. More and more software is available on CD-ROM-even Windows 95 and Windows NT are available on CD-ROM. In the future, more software programs will use CD-ROMs as their distribution medium because CDROMs offer several advantages:
Microsoft's having built CD-ROM support directly into Windows 95 and Windows NT will certainly help to promote the use and wide acceptance of CD-ROMs in the marketplace.
The best aspect of all these file systems is that they provide simultaneous operating system support. If you are using Windows NT, you can easily have one partition on your hard disk formatted for FAT and another formatted for NTFS. Then you can easily copy files from either of these partitions to a floppy disk formatted for the FAT file system.
Win32's Filename Conventions
So that Win32 can support several different file systems, all the file systems must observe some ground rules. The most important rule is that each file system must organize files into a hierarchical directory tree just as the FAT file system does. Directory names and filenames in the pathname must be separated by the backslash (\) character. In addition to the rules for constructing pathnames, there are rules for constructing directory names and filenames.
- All pathnames must be zero-terminated.
- Directory names and filenames must not contain the backslash separator character (\), a character whose ASCII value is in the range 0 through 31, or any character explicitly disallowed by any of the file systems.
- Directory names and filenames can be created in mixed case, but users must anticipate that searches for directories and files will always be performed by means of case-insensitive comparisons. If a file called ReadMe.Txt already exists and you try to name another file README.TXT, the naming of the second file will fail.
- When used to specify a directory name, the period (.) identifies the current directory. For example, the pathname \READ ME.TXT indicates that the file is in the current directory
- When used to specify a directory name, two periods (..) identify the parent directory of the current directory. For example, the pathname ..\README.TXT indicates that the file is in the current directory's parent directory....