Microsoft KB Archive/161982

{|
 * width="100%"|

PRB: Win 95 Copies Fewer Files in Root Directories than Win NT

 * }

Q161982

-

The information in this article applies to:


 * Microsoft Win32 Application Programming Interface (API), used with:
 * Microsoft Windows 95
 * the operating system: Microsoft Windows 2000

-

SYMPTOMS
Applications on Windows NT successfully copy up to 224 files to the root directory of a 1.44MB floppy disk. However, on Windows 95, they can only copy up to 112 files. In each case, the file names are mixed-case but use the standard 8.3 format (short filenames).

Because of this behavior, Windows 95 can save only half as many short mixed- case filenames in the root directory of all sizes of floppy and hard disks as Windows NT. This rarely becomes a problem because the maximum number of entries in the root directories for all floppy disks and hard disks is much larger than is actually needed to store files in a root directory.

CAUSE
Windows 95 and Windows NT behave differently because of the way the two platforms store mixed-case short (8.3) filenames. Windows NT stores each mixed-case short filename in a single directory entry with its case preserved. Windows 95, however, creates two directory entries for mixed- case short filenames: one entry is for the 8.3 name in all upper-case (as MS-DOS stores filenames); the second is for a long filename entry that stores the filename in mixed-case.

Although Windows 95 stores mixed-case short filenames with two directory entries, it stores all upper-case short filenames in a single directory entry just as MS-DOS does.

RESOLUTION
There is no direct means for Win32 applications to determine the exact number of unused root directory entries on a FAT volume, nor should applications rely on there being a certain number free. In fact, applications that are dependent on putting files into the root directory should not be developed.

You can take two approaches to handle this difference in behavior between platforms:


 * You can force Windows 95 to create a single directory entry by using all uppercase and conforming to the 8.3 format. For example, specify your file as "TEST.TXT" instead of "test.txt." This will prevent Windows 95 from creating the long filename directory entries.
 * You can copy mixed-case files into a sub-directory. The root directory is the only directory with a fixed number of entries; all other directories can contain as many files as will fit onto the floppy disk.

STATUS
The behavior difference is by design due to implementation choices made in the two platforms.

Additional query words: 4.00 4.0 95 kbdss floppy LFN diskette SFN

Keywords : kbAPI kbFileIO kbKernBase kbOSWin2000 kbDSupport kbGrpDSKernBase

Issue type : kbprb

Technology : kbAudDeveloper kbWin32sSearch kbWin32API