From b2d3ffde57f166662936931b065a4fae22be53f3 Mon Sep 17 00:00:00 2001 From: Xavier Leroy Date: Thu, 10 Feb 2000 14:01:39 +0000 Subject: [PATCH] Doc de input git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@2801 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02 --- stdlib/pervasives.mli | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/stdlib/pervasives.mli b/stdlib/pervasives.mli index 53ce1dc65..2b46f0e85 100644 --- a/stdlib/pervasives.mli +++ b/stdlib/pervasives.mli @@ -526,14 +526,18 @@ val input_line : in_channel -> string Raise [End_of_file] if the end of the file is reached at the beginning of line. *) val input : in_channel -> buf:string -> pos:int -> len:int -> int - (* Attempt to read [len] characters from the given channel, + (* Read up to [len] characters from the given channel, storing them in string [buf], starting at character number [pos]. It returns the actual number of characters read, between 0 and [len] (inclusive). A return value of 0 means that the end of file was reached. A return value between 0 and [len] exclusive means that - no more characters were available at that time; [input] must be - called again to read the remaining characters, if desired. + not all requested [len] characters were read, either because + no more characters were available at that time, or because + the implementation found it convenient to do a partial read; + [input] must be called again to read the remaining characters, + if desired. (See also [Pervasives.really_input] for reading + exactly [len] characters.) Exception [Invalid_argument "input"] is raised if [pos] and [len] do not designate a valid substring of [buf]. *) val really_input : in_channel -> buf:string -> pos:int -> len:int -> unit