Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] how to do a browser
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: IKEDA Katsumi <ikeda@m...>
Subject: Re: [Caml-list] how to do a browser
Oops! I forgot Unix.closedir.

From: IKEDA Katsumi <ikeda@msi.co.jp>
Message-ID: <20030313194508H.ikeda@msi.co.jp>
> let my_ls path =
>   let dh = Unix.opendir path in
>   try
>     while (true) do
>       print_endline (Unix.readdir dh);
>     done
>   with End_of_file -> ();;

let my_ls path =
  let dh = Unix.opendir path in
  try
    while (true) do
      print_endline (Unix.readdir dh);
    done
  with End_of_file -> Unix.closedir dh;;

-- 
IKEDA Katsumi  <ikeda@msi.co.jp>

-------------------
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