Module Disk

Disks and partitions.

Disks

type t

The type for disks

val make : ?sector_size:int -> Unix.file_descr -> (t, string) Stdlib.result

make fd reads a disk from fd. The disk is assumed to start at the current file descriptor position and to have sectors of byte size sector_size.

val sector_size : t -> int

sector_size d is the sector size of d.

val first_byte : t -> int

first_byte d is the first byte of d. This is the fd position when make was called.

val fd : t -> Unix.file_descr

fd is the file desciptor of fd.

Logical block addressing

type lba = int

The type for logical block addreses.

val lba_byte_pos : t -> lba -> int

lba_byte_pos ~sector_size lba is the byte position of lba. sector_size defaults to 512. disk_first_byte defaults to 0.

Partitions

module Partition : sig ... end

Disk partitions.