delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1999/09/14/07:36:12

From: Martin Stromberg <Martin DOT Stromberg AT lu DOT erisoft DOT se>
Message-Id: <199909141031.MAA22215@propus.lu.erisoft.se>
Subject: Re: FAT32 detection
To: djgpp-workers AT delorie DOT com (DJGPP-WORKERS)
Date: Tue, 14 Sep 1999 12:31:07 +0200 (MET DST)
X-Mailer: ELM [version 2.4 PL24]
MIME-Version: 1.0
Reply-To: djgpp-workers AT delorie DOT com

Eli said:
> On NT 4.0sp3: A: returns FAT12, but H: (a networked disk mounted via NFS) 
> returns FAT16.  I guess you need to check for the drive type explicitly.
> Also, C:, an NTFS partition, returns FAT16.  What do we want an NTFS 
> partition to return?

Arrgh! NTFS should return -1 (FAT size is not defined on such a beast, to 
my knowledge). How do I check the drive type?

>       if( number_of_clusters < 4085 )
>       {
>         size = 12;
>       }
>       else if( number_of_clusters < 65525 )
>       {
>         size = 16;
>       }
>       else
>       {
>         size = 32;
>       }
> 
> Is the above logic safe?  For example, are all FAT12 floppies less
> than 4K clusters?  What about the Microsoft 2MB format?  Also, can't
> there be a FAT32 volume with less than 64K clusters?

It's straight from the horse's mouth (that is the proverb, isn't it?):
go to <http://www.microsoft.com/hwdev/> and click on "Microsoft Extensible 
Firmware Initiative FAT32 File System Specification" and click some more.


Right,

							MartinS

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019