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

Safe HaskellNone

Data.Vhd

Synopsis

Documentation

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

Creates an empty VHD file with the specified parameters.

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

Retrieves the header and footer from a VHD file.

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

readData :: Vhd -> IO ByteStringSource

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

readDataRangeSource

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.

writeDataRangeSource

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 aSource

class Sized a whereSource

Methods

sized :: Num n => a -> nSource

Instances

newtype BlockSize Source

block size

Constructors

BlockSize Word32 

newtype BlockByteAddress Source

The offset from the beginning of a block in bytes

Constructors

BlockByteAddress Word32 

vaddrNextBlock :: VirtualByteAddress -> BlockSize -> VirtualByteAddressSource

increment the virtual address to align to the next block

newtype Cookie Source

Constructors

Cookie ByteString 

Instances

cookie :: ByteString -> CookieSource

smart constructor for Cookie

creatorApplication :: ByteString -> CreatorApplicationSource

smart constructor for CreatorApplication

parentLocatorEntries :: [ParentLocatorEntry] -> ParentLocatorEntriesSource

smart constructor for ParentLocatorEntries

uniqueId :: ByteString -> UniqueIdSource

smart constructor for uniqueId