vhd-0.2.2: Provides functions to inspect and manipulate virtual hard disk (VHD) files.

Safe HaskellNone
LanguageHaskell98

Data.Vhd

Synopsis

Documentation

create :: FilePath -> CreateParameters -> IO () #

Creates an empty VHD file with the specified parameters.

getInfo :: FilePath -> IO (Either String (Header, Footer)) #

Retrieves the header and footer from a VHD file.

snapshot :: Vhd -> FilePath -> IO () #

readData :: Vhd -> IO ByteString #

Reads data from the whole virtual address space of the given VHD.

readDataRange #

Arguments

:: Vhd

Vhd chain to read from

-> Word64

offset address in the VHD

-> Word64

number of byte to read

-> IO ByteString 

Reads data from the given virtual address range of the given VHD.

TODO: modify this function to read sub-blocks where appropriate.

writeDataRange #

Arguments

:: Vhd

Vhd chain to write to

-> Word64

offset address in the VHD

-> ByteString

the data to write in the VHD

-> IO () 

Writes data to the given virtual address of the given VHD.

withVhd :: FilePath -> (Vhd -> IO a) -> IO a #

class Sized a where #

Minimal complete definition

sized

Methods

sized :: Num n => a -> n #

Instances

Sized Header # 

Methods

sized :: Num n => Header -> n #

Sized Footer # 

Methods

sized :: Num n => Footer -> n #

newtype BlockSectorAddress #

The offset from the beginning of a block in sectors

Instances

Enum BlockSectorAddress # 
Eq BlockSectorAddress # 
Num BlockSectorAddress # 
Ord BlockSectorAddress # 
Show BlockSectorAddress # 

newtype VirtualBlockAddress #

The absolute number of the block

Instances

Enum VirtualBlockAddress # 
Eq VirtualBlockAddress # 
Num VirtualBlockAddress # 
Ord VirtualBlockAddress # 
Show VirtualBlockAddress # 

newtype VirtualByteAddress #

An absolute address in byte in the vhd content space

Instances

Enum VirtualByteAddress # 
Eq VirtualByteAddress # 
Num VirtualByteAddress # 
Ord VirtualByteAddress # 
Show VirtualByteAddress # 

vaddrNextBlock :: VirtualByteAddress -> BlockSize -> VirtualByteAddress #

increment the virtual address to align to the next block

data Version #

Instances

newtype Cookie #

Constructors

Cookie ByteString 

Instances

Eq Cookie # 

Methods

(==) :: Cookie -> Cookie -> Bool #

(/=) :: Cookie -> Cookie -> Bool #

Show Cookie # 

cookie :: ByteString -> Cookie #

smart constructor for Cookie

creatorApplication :: ByteString -> CreatorApplication #

smart constructor for CreatorApplication

parentLocatorEntries :: [ParentLocatorEntry] -> ParentLocatorEntries #

smart constructor for ParentLocatorEntries

uniqueId :: ByteString -> UniqueId #

smart constructor for uniqueId