The Windows NT File System (NTFS)

Like HPFS, NTFS organizes data on hard disks but not on floppy disks. NTFS supports object-oriented applications by treating files as objects with user-defined and system-defined attributes. It provides all the capabilities of the FAT and HPFS file systems without many of their limitations.

NTFS is also a fully recoverable file system, designed to restore consistency to a disk after a CPU failure, a system crash, or an I/O error. If you crash your NTFS volume, chances are that you will be able to recover your data. NTFS allows the operating system to recover without requiring you to use the autochk or chkdsk command, which saves a lot of time when you must reboot after a system failure. Have you ever crashed an HPFS volume and then had to sit and wait while chkdsk ran on your 1-gigabyte drive? I hope you brought a book to pass the time. (NTFS does provide chkdsk and autochk in case the recovery fails or corruption occurs outside the control of the file system.)

NTFS includes features not available in FAT or HPFS, such as security, Unicode filenames, automatic creation of MS-DOS aliases, multiple data streams, and unique functionality specific to the POSIX subsystem (a collection of international standards for UNIX-style operating system interfaces). NTFS follows the HPFS filename conventions described in the preceding section, but it also supports Unicode filenames, implemented internally in Windows NT. NTFS cannot manipulate a file's extended attributes if the file was created in HPFS.

NTFS supports filenames with as many as 256 characters, including a terminating null. In most cases, it also generates an MS-DOS–compatible filename in 8.3 format that allows an application based on MS-DOS or 16-bit Windows to access the same file. (When the NTFS directory name or filename contains spaces and fewer than eight characters, NTFS does not create an 8.3 filename.) To translate a long filename into an 8.3 filename, NTFS uses the following guidelines:

." / \ [] : ; = ,

This is a really long filename.123.456.789.TXT

becomes

THISIS~1.TXT

This is a really long filename.123.456.789.

becomes

THISIS~1.789

NOTE: If you're working with an application based on MS-DOS or Windows 3.x, you might occasionally need to save a file from that application on an NTFS volume. If the application saves to a temporary file, deletes the original file, and renames the temporary file to the original filename, the long filename will be lost. You will also lose any unique permissions set on that file, although you can reset the permissions from the parent directory.

Long Filenames and Novell NetWare

Versions of Novell NetWare earlier than 3.12 can support long filenames, but the servers require that you enable Macintosh or OS/2 (HPFS) name spaces to do so. This is costly in terms of RAM on the server, and you must use NetWare-specific name space APIs to access the long filenames.

The good news is that if you write a Win32 application using the Win32 file system calls, you can check to see whether a given volume supports long filenames and can use the long names without worrying about the server system. The Microsoft-developed Windows 95 client for NetWare will use the OS/2 name space, when available, to store filenames containing as many as 254 characters (including the terminating null) and will make the Win32 API available. If you are running the real-mode Novell client, or if the server has not been enabled for long filenames, you can use only 8.3 filenames.