package gapi-ocaml

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

An implementation of mime_body where the value is stored * in an external file. * * The argument is the name of the file containing the (decoded) value. * The method store returns `File filename. * The method value loads the contents of the file and returns them * as string. * * Example: To create a body from the file "f", call *

new file_mime_body "f" 

* *

  • parameter fin

    whether to delete the file when the finalize method is called * (default: false)

inherit mime_body_ro

Supports all these read access method, too

method ro : bool

whether this body is read-only or not

method set_value : string -> unit

Sets the value. If the value is immutable, the exception * Immutable will be raised. * * The passed string must be in decoded form. When the body is * stored in an external file, the file is overwritten.

method open_value_wr : unit -> Netchannels.out_obj_channel

Opens the value for writing. The current value is overwritten. * If the value is immutable, the exception Immutable will be raised. * * For example, to copy the file f into the value: *

* let ch = body # open_value_wr() in
* let f_ch = new Netchannels.input_file f in
* ch # output_channel f_ch;
* f_ch # close_in();
* ch # close_out();
* 

*

OCaml

Innovation. Community. Security.