From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id UAA18136; Fri, 13 Sep 2002 20:27:39 +0200 (MET DST) Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id UAA18232 for ; Fri, 13 Sep 2002 20:27:38 +0200 (MET DST) Received: from lithinos.com ([192.41.68.34]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id g8DIRa118166 for ; Fri, 13 Sep 2002 20:27:37 +0200 (MET DST) Received: (from lought@localhost) by lithinos.com (8.12.5/8.11.0) id g8DIPqd8010033; Fri, 13 Sep 2002 12:25:52 -0600 Date: Fri, 13 Sep 2002 12:25:52 -0600 Message-Id: <200209131825.g8DIPqd8010033@lithinos.com> X-Authentication-Warning: lithinos.com: lought set sender to rich@lithinos.com using -f From: "Richard" To: caml-list@inria.fr Subject: [Caml-list] Reading from a stream until '\000' - will this approach work? X-Mailer: NeoMail 1.25 X-IPAddress: 161.28.6.20 MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk After thinking a bit more about it... (* Please read disclaimer comments first :) *) How about - (*I'm not sure what the name of the method to read in just one character is... 'read_char' ??*) (*I'm also not sure how to tack that character from the stream onto an ever growing string... '^' ?? *) (*I still need to read about how to break out of a loop... 'break' ??*) let rec myStreamReader inchan = let char = read_char inchan in if char = '\000' then let holderString = holderString ^ char and break else myStreamReader inchan ;; Again - I hope I'm able to make sense... Thanks for any feedback on the concept! -Richard ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners