SuperFloppyFormatter超过512 MB返回FAT32? [英] SuperFloppyFormatter returning FAT32 for anything over 512 MB?
问题描述
我使用 Android作业工具 FAT12驱动器支持的最大大小是32 MB,而FAT16驱动器的最大大小是2 GB。为什么这个图书馆将这些限制强加在4 MB和512 MB?看起来作者可能已经基于这种对FAT12和FAT16如何工作的天真的理解。 < 4MB当然是≤4095KB。 4095是十六进制0xFFF,或二进制1111 1111 1111 ...这实际上代表了12位... 我承认我不太了解自己发胖(我还没有完全理解行业与集群,总可用规模是如何计算的等)。也许有人更好地理解这些事情可以证实,如果有一个技术原因,为什么这个实现应该被认为是正确的?因为它看起来像是我的问题的确切原因。 谢谢! FAT12只有16MB,而不是32MB。 可能笔者正在检查的数量是: 对于FAT16:65526(群集大小2 - 32 KB)(不清楚他为什么要用512然后)。 对于FAT32:〜268,435,456(簇大小4 - 32 KB) 详细信息: a href =http://www.pcguide.com/ref/hdd/file/partSizes-c.html =nofollow> http://www.pcguide.com/ref/hdd/file/partSizes- c.html 报告该问题; I am using the de.waldheinz.fs libraries in relation to the Android jobb tool, and I came across something that seems rather bizarre. In the file de.waldheinz.fs.fat.SuperFloppyFormatter.java:304 I find this: The maximum size supported by a FAT12 drive is 32 MB, and for a FAT16 drive is 2 GB. Why is this library imposing these limits at 4 MB and 512 MB? It appears that the author may have based this on a rather naive understanding of how FAT12 and FAT16 work. < 4MB would of course be <= 4095 KB. 4095 being 0xFFF in hexadecimal, or 1111 1111 1111 in binary...this effectively represents 12 bits... I'll admit that I don't know much about FAT myself (I still don't fully understand sectors vs clusters, how the total available size is calculated, etc.). Perhaps someone who better understands these things could confirm if there's a technical reason why this implementation should be considered "right"? Because it looks like the exact cause for my problems. Thanks! FAT12 is only 16MB, not 32MB. Probably the author is checking the number of clusters which are: For FAT12: 4086 (cluster size 0.5 - 4 KB) For FAT16: 65526 (cluster size 2 - 32 KB) (not clear why he's checking with 512 then). For FAT32: ~268,435,456 (cluster size 4 - 32 KB) Details here: http://www.pcguide.com/ref/hdd/file/partSizes-c.html Report the issue in that library ;) 这篇关于SuperFloppyFormatter超过512 MB返回FAT32?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
$ b $ pre $ public static FatType fatTypeFromSize(long sizeInBytes){
final long sizeInMb = sizeInBytes /(1024 * 1024);
if(sizeInMb< 4)返回FatType.FAT12;
else if(sizeInMb< 512)return FatType.FAT16;
else返回FatType.FAT32;
$ / code $ / pre
$ b $ FatType
这里是枚举 de.waldheinz.fs.fat.FatType
,但是这里的实现很简单。我的问题确实与行有关,否则if(sizeInMB< 512)返回FatType.FAT16;
,但FAT12的检查同样麻烦。 b
$ b $ p
FAT12:4086(群集大小0.5 - 4 KB)
public static FatType fatTypeFromSize(long sizeInBytes) {
final long sizeInMb = sizeInBytes / (1024 * 1024);
if (sizeInMb < 4) return FatType.FAT12;
else if (sizeInMb < 512) return FatType.FAT16;
else return FatType.FAT32;
}
FatType
here is the enum de.waldheinz.fs.fat.FatType
, but the implementation is straightforward enough here. My issue really pertains to the line else if (sizeInMB < 512) return FatType.FAT16;
, but the check for FAT12 is equally bothersome.