package vhd-format-lwt

  1. Overview
  2. Docs
Pure OCaml library for reading and writing .vhd format data

Install

Dune Dependency

Authors

Maintainers

Sources

v0.9.2.tar.gz
sha256=738682ab4378f23e44c795592a3de0075559d3b69ec21899e40fbd2f8a05e32c
md5=8ee9a2a09b564a9d2c5b64a8bacf0524

Description

It has a particular emphasis on efficient streaming and format conversion.

Tags

org:mirage org:xapi-project

Published: 16 Mar 2018

README

ocaml-vhd

A pure OCaml library to read and write vhd format data, plus a simple command-line tool which allows vhd files to be interrogated, manipulated, format-converted and streamed to and from files and remote servers.

Example usage

To initialise your environment in utop:

open Lwt;;
#require "vhd-format";;
#require "vhd-format-lwt";;
module V = Vhd.Make(Vhd_lwt);;

To open a file and read the first sector:

V.Vhd_IO.openfile "foo.vhd" >>= fun f -> V.Vhd_IO.read_sector f 0L;;
- : Cstruct.t option = Some {Cstruct.buffer = <abstr>; off = 0; len = 512}   

To read the vhd file header:

V.Vhd_IO.openfile "89a62601-c82a-447a-a7fd-f7f379195e80.vhd" >>= fun f -> return f.Vhd.Vhd.header;;
- : Vhd.Header.t = {
 Vhd.Header.table_offset = 1536L; max_table_entries = 12288;
 block_size_sectors_shift = 12; checksum = -3001l; parent_unique_id = <abstr>;  
 parent_time_stamp = 0l; parent_unicode_name = [||];
 parent_locators =
  [|{Vhd.Parent_locator.platform_code = Vhd.Platform_code.None;
     platform_data_space = 0l; platform_data_space_original = 0l;
     platform_data_length = 0l; platform_data_offset = 0L;
     platform_data = {Cstruct.buffer = <abstr>; off = 0; len = 0}};
    {Vhd.Parent_locator.platform_code = Vhd.Platform_code.None;
     platform_data_space = 0l; platform_data_space_original = 0l;
     platform_data_length = 0l; platform_data_offset = 0L;
     platform_data = {Cstruct.buffer = <abstr>; off = 0; len = 0}};
    {Vhd.Parent_locator.platform_code = Vhd.Platform_code.None;
     platform_data_space = 0l; platform_data_space_original = 0l;
     platform_data_length = 0l; platform_data_offset = 0L;
     platform_data = {Cstruct.buffer = <abstr>; off = 0; len = 0}};
    {Vhd.Parent_locator.platform_code = Vhd.Platform_code.None;
     platform_data_space = 0l; platform_data_space_original = 0l;
     platform_data_length = 0l; platform_data_offset = 0L;
     platform_data = {Cstruct.buffer = <abstr>; off = 0; len = 0}};
    {Vhd.Parent_locator.platform_code = Vhd.Platform_code.None;
     platform_data_space = 0l; platform_data_space_original = 0l;
     platform_data_length = 0l; platform_data_offset = 0L;
     platform_data = {Cstruct.buffer = <abstr>; off = 0; len = 0}};
    {Vhd.Parent_locator.platform_code = Vhd.Platform_code.None;
     platform_data_space = 0l; platform_data_space_original = 0l;
     platform_data_length = 0l; platform_data_offset = 0L;
     platform_data = {Cstruct.buffer = <abstr>; off = 0; len = 0}};
    {Vhd.Parent_locator.platform_code = Vhd.Platform_code.None;
     platform_data_space = 0l; platform_data_space_original = 0l;
     platform_data_length = 0l; platform_data_offset = 0L;
     platform_data = {Cstruct.buffer = <abstr>; off = 0; len = 0}};
    {Vhd.Parent_locator.platform_code = Vhd.Platform_code.None;
     platform_data_space = 0l; platform_data_space_original = 0l;
     platform_data_length = 0l; platform_data_offset = 0L;
     platform_data = {Cstruct.buffer = <abstr>; off = 0; len = 0}}|]}

Dependencies (8)

  1. vhd-format >= "0.9.1" & < "0.10.0"
  2. ounit
  3. mirage-types-lwt >= "3.0.0" & < "3.7.0"
  4. mirage-block < "2.0.0"
  5. lwt >= "2.4.3" & <= "3.1.0"
  6. cstruct < "6.0.0"
  7. jbuilder >= "1.0+beta7"
  8. ocaml >= "4.03.0" & < "4.06.0"

Dev Dependencies (1)

  1. io-page-unix with-test

Used by

None

Conflicts

None

OCaml

Innovation. Community. Security.