caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] how to do a browser
@ 2003-03-13 10:01 deerf hal
  2003-03-13 10:45 ` IKEDA Katsumi
  0 siblings, 1 reply; 3+ messages in thread
From: deerf hal @ 2003-03-13 10:01 UTC (permalink / raw)
  To: caml-list


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





_________________________________________________________________
Pro ou perso, toutes les adresses et numéros de tél que vous cherchez 
http://g.msn.fr/FR1000/9491

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


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Caml-list] how to do a browser
  2003-03-13 10:01 [Caml-list] how to do a browser deerf hal
@ 2003-03-13 10:45 ` IKEDA Katsumi
  2003-03-13 10:55   ` IKEDA Katsumi
  0 siblings, 1 reply; 3+ messages in thread
From: IKEDA Katsumi @ 2003-03-13 10:45 UTC (permalink / raw)
  To: caml-list

Hi,

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
  try
    while (true) do
      print_endline (Unix.readdir dh);
    done
  with End_of_file -> ();;
# my_ls "/usr";;

Regards,

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


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Caml-list] how to do a browser
  2003-03-13 10:45 ` IKEDA Katsumi
@ 2003-03-13 10:55   ` IKEDA Katsumi
  0 siblings, 0 replies; 3+ messages in thread
From: IKEDA Katsumi @ 2003-03-13 10:55 UTC (permalink / raw)
  To: caml-list

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


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2003-03-13 10:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-03-13 10:01 [Caml-list] how to do a browser deerf hal
2003-03-13 10:45 ` IKEDA Katsumi
2003-03-13 10:55   ` IKEDA Katsumi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).