ironfede / openmcdf

Microsoft Compound File .net component - pure C# - netstandard 2.0
Mozilla Public License 2.0
308 stars 76 forks source link

How to know the size of a Compound file? #129

Open alanccw opened 4 months ago

alanccw commented 4 months ago

Hi,

Is there a way to know the size of a compound file via its header?

Or, alternative, get the total number of sectors, including the FAT sectors, dir sectors and user data sectors, from the header in the compound file?

Numpsy commented 4 months ago

The numbers of sectors are stored in the header - ref https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-cfb/05060311-bfce-4b12-874d-71fd4ce63aea - I haven't looked at this part in much detail though.

alanccw commented 4 months ago

@Numpsy

No, in your link, there are:

  1. Number of Directory Sectors
  2. Number of FAT Sectors
  3. Number of Mini FAT Sectors
  4. Number of DIFAT Sectors

But the most important number, the number of normal data sectors are missing. So I cannot calculate the total number of sectors in the file