Page 1 of 1

How to know BytesperSector?

Posted: Mon Apr 05, 2004 10:22 pm
by Psychophanta
Does anybody know a quick and short way to know the bytes number per sector in a given data store device?

Posted: Tue Apr 06, 2004 12:45 am
by Soulfire
Isn't it like always 512?

Posted: Tue Apr 06, 2004 1:36 pm
by freak

Code: Select all

Drive$ = "C:\"

If GetDiskFreeSpace_(@Drive$, @SectorsperCluster.l, @BytesPerSector.l, @FreeClusters.l, @TotalClusters.l)

  Debug "BytesPerSector: "+Str(BytesPerSector)
  
Else

  Debug "error!"

EndIf
Note: The other values you get there are quite useless, because they are only
correct for drives smaller than 2GB.

The BytesPerSector value should be correct tough, even if the drive is too big. (acording to MS docs)

Timo

Posted: Wed Apr 07, 2004 5:56 pm
by Psychophanta
Thanx Freak, it is what i needed :)