package swapfs

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Module type Swapfs.SSource

Sourcetype t

The swap filesystem

Sourcetype handle

A handle for a growable unnamed file on the swap filesystem

Sourcetype error
Sourceval pp_error : Format.formatter -> error -> unit
Sourceval empty : t -> handle

empty t is a handle handle for an empty unnamed file. Gc.finalise free handle is called so garbage collected handles automatically result in freed blocks. However, it is recommended to call free handle manually earlier.

Sourceval append : handle -> string -> (unit, error) result Lwt.t

Write data to the end of the unnamed file. Block allocations are done as needed.

Sourceval size : handle -> int64

size handle is the length of the unnamed file represented by handle

Sourceval get_partial : handle -> offset:int64 -> length:int -> (string, error) result Lwt.t

get_partial handle ~offset ~length reads length bytes at offset offset from the unnamed file represented by handle. Errors can happen.

Sourceval free : handle -> unit Lwt.t

free handle marks all blocks allocated for handle as free and resets handle to zero length. handle can be reused.

OCaml

Innovation. Community. Security.