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 WAA16531; Mon, 6 Aug 2001 22:38:09 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id WAA16529 for ; Mon, 6 Aug 2001 22:38:07 +0200 (MET DST) Received: from stb-mail-01.adept.za.net (stb-mail-01.adept.za.net [64.245.11.2]) by nez-perce.inria.fr (8.11.1/8.10.0) with ESMTP id f76Kc1D15373 for ; Mon, 6 Aug 2001 22:38:03 +0200 (MET DST) Received: from spyker (p18.dialup-01.adept.za.net [64.245.12.18]) by stb-mail-01.adept.za.net (Postfix) with ESMTP id 6E2101FF85 for ; Mon, 6 Aug 2001 22:37:56 +0200 (SAST) Received: from js by spyker with local (Exim 3.12 #1 (Debian)) id 15Tr7V-0002im-00 for ; Mon, 06 Aug 2001 22:37:01 +0200 To: caml-list@inria.fr Subject: [Caml-list] using open_out_gen, output_string and close_out From: Johann Spies Date: 06 Aug 2001 22:37:01 +0200 Message-ID: <8766c12adu.fsf@adept.co.za> User-Agent: Gnus/5.0803 (Gnus v5.8.3) Emacs/20.7 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk The following illustrates my problem: ------------------------------- $ocaml Objective Caml version 3.00 # let l = open_out_gen [Open_creat;Open_append] 0o666 "/tmp/xx";; val l : out_channel = # close_out l;; - : unit = () # let l = open_out_gen [Open_creat;Open_append] 0o666 "/tmp/xx";; val l : out_channel = # output_string l "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb ccccccccccccccccccccccccccccccccc";; - : unit = () # close_out l;; Uncaught exception: Sys_error "Bad file descriptor". # ------------------------------------------------------ What is happening here? After exiting ocaml, the file /tmp/xx was empty. Johann -- J.H. Spies - Tel. 082 782 0336 / 021-808 4036(w) Posbus 4668, Tygervallei 7536 "Be still before the LORD and wait patiently for him; do not fret when men succeed in their ways, when they carry out their wicked schemes." Psalms 37:7 ------------------- Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr