Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] using open_out_gen, output_string and close_out
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Johann Spies <jhspies@a...>
Subject: [Caml-list] using open_out_gen, output_string and close_out
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 = <abstr>
# close_out l;;
- : unit = ()
# let l = open_out_gen [Open_creat;Open_append] 0o666 "/tmp/xx";;
val l : out_channel = <abstr>
# 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