package opam-format

  1. Overview
  2. Docs

Switch state file as table, also used for import/export. This includes compiler and root packages information, as well as pinned packages and their target (but not their local metadata).

include IO_FILE with type t := t
val empty : t

Empty file

val write : t typed_file -> t -> unit

Write some contents to a file

val read : t typed_file -> t

Read file contents. Raise an error if the file does not exist.

val read_opt : t typed_file -> t option

Returns None on non-existing file

val safe_read : t typed_file -> t

Read file contents. Return empty if the file does not exist.

val read_from_channel : ?filename:t typed_file -> Stdlib.in_channel -> t
val read_from_string : ?filename:t typed_file -> string -> t
val write_to_channel : ?filename:t typed_file -> Stdlib.out_channel -> t -> unit
val write_to_string : ?filename:t typed_file -> t -> string
OCaml

Innovation. Community. Security.