package moss

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

Representation of "files", what is their name, how to access their content.

type t

Abstract representation of files (names to submit to MOSS and method to access their data).

val name : t -> string

Return the name used to upload the file.

val of_string : name:string -> string -> t

of_string name content return a "file" with given name and content.

val of_path : ?name:string -> string -> t

of path path create a "file" from a (full or relative) path.

  • parameter name

    the name to submit to MOSS. By default it is the same as path.

val of_in_channel : ?size:int -> name:string -> (unit -> in_channel) -> t

of_in_channel name create return a "file" from a channel created with create. The channel will be created (and then closed) when the file is sent with submit. For regular files, it is recommended to use of_path instead.

  • parameter size

    the number of bytes to read on the channel (the channel will be set to binary mode so no newline conversions will be performed). By default, the channel will be read until End_of_file (and then closed) and the size computed from that data.

class type in_obj_channel = object ... end

The most basic input object for best interoperability.

val of_in_obj : ?size:int -> name:string -> (unit -> in_obj_channel) -> t

of_in_obj name create return a "file" from an channel created with create. The channel will be created (and then closed) when the file is sent with submit.

  • parameter size

    the number of bytes to read on the channel (the channel will be set to binary mode so no newline conversions will be performed). By default, the channel will be read until End_of_file (and then closed) and the size computed from that data.

OCaml

Innovation. Community. Security.