English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

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: 2003-03-13 (10:45)
From: IKEDA Katsumi <ikeda@m...>
Subject: Re: [Caml-list] how to do a browser

From: "deerf hal" <halnaf@hotmail.com>
Message-ID: <F63peKIf5jJSzhI7Vjo00008db8@hotmail.com>
> i have look to ocamlbrowser sources but it is a little bit hard to 
> understand the code.
> i suppose that could be done with a listbox (with option brower) but i don't 
> know how to have the list of the files of a directory
> thank

To have it, use Unix.opendir and Unix.readdir.

For example,

let my_ls path =
  let dh = Unix.opendir path in
    while (true) do
      print_endline (Unix.readdir dh);
  with End_of_file -> ();;
# my_ls "/usr";;


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