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

Last reviewed: January 11, 1997
Article ID: Q161982
The information in this article applies to:
  • Microsoft Win32 Application Programming Interface (API), for Windows 95, version 4.00

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.


KBCategory: kbprg kbprb
KBSubcategory: BseFileio
Additional reference words: 4.00 4.0 95 kbdss floppy LFN diskette SFN



THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: January 11, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.